8 months ago
I already using dotnet 8 in my application, I already did configure NIXPACKSCSHARPSDK_VERSION to 8.0 and my application is running by my container in my desktop :(
10 1.487 /nix/store/0f43yfx91hg74bcp66qkbp97zv3ln27i-dotnet-sdk-6.0.413/sdk/6.0.413/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 8.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 8.0. [/app/CentroDosPneus/CentroDosPneus.csproj]
10 1.487 /nix/store/0f43yfx91hg74bcp66qkbp97zv3ln27i-dotnet-sdk-6.0.413/sdk/6.0.413/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 8.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 8.0. [/app/Service/Service.csproj]
10 1.487 /nix/store/0f43yfx91hg74bcp66qkbp97zv3ln27i-dotnet-sdk-6.0.413/sdk/6.0.413/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 8.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 8.0. [/app/Repository/Repository.csproj]
10 ERROR: process "/bin/bash -ol pipefail -c dotnet restore" did not complete successfully: exit code: 1
[6/9] RUN dotnet restore:
0.246 Write your first app: https://aka.ms/dotnet-hello-world
0.246 Find out what's new: https://aka.ms/dotnet-whats-new
0.246 Explore documentation: https://aka.ms/dotnet-docs
0.246 Report issues and find source on GitHub: https://github.com/dotnet/core
0.246 Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
0.246 --------------------------------------------------------------------------------------
1.460 Determining projects to restore…
1.487 /nix/store/0f43yfx91hg74bcp66qkbp97zv3ln27i-dotnet-sdk-6.0.413/sdk/6.0.413/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 8.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 8.0. [/app/CentroDosPneus/CentroDosPneus.csproj]
1.487 /nix/store/0f43yfx91hg74bcp66qkbp97zv3ln27i-dotnet-sdk-6.0.413/sdk/6.0.413/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 8.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 8.0. [/app/Service/Service.csproj]
1.487 /nix/store/0f43yfx91hg74bcp66qkbp97zv3ln27i-dotnet-sdk-6.0.413/sdk/6.0.413/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 8.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 8.0. [/app/Repository/Repository.csproj]
Dockerfile:19
17 | # install phase
18 | COPY . /app/.
19 | >>> RUN dotnet restore
20 |
21 | # build phase
ERROR: failed to solve: process "/bin/bash -ol pipefail -c dotnet restore" did not complete successfully: exit code: 1
Error: Docker build failed
ⓘ Deployment information is only viewable by project members and Railway employees.
1 Replies
7 months ago
add dockerfile to the root of your project in visualstudio (add -> create element -> name it "Dockerfile" without any extention
paste this inside the file
# Use Microsoft's .NET 8.0 SDK imageFROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
# Set up the app environment
WORKDIR /app
# Copy everything and build
COPY . ./
RUN dotnet publish -c Release -o out
# Runtime image
FROM mcr.microsoft.com/dotnet/aspnet:8.0
WORKDIR /app
COPY --from=build-env /app/out .
# Start the app
ENTRYPOINT ["dotnet", "YourApp.dll"]
rename YorApp to actual name of the project