DevOps: 'NuGet restore' error with .Net 8
# help-with-other
a
I'm attempting to release Umbraco 13 via a DevOps pipeline, but running into the following error when running the 'NuGet restore' task:
Copy code
##[error]The nuget command failed with exit code(1) and error(C:\Program Files\dotnet\sdk\6.0.203\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. [D:\a\1\s\src\UmbracoProject\UmbracoProject.csproj]
Reading into this message it implies that .Net 6 is being chosen instead of .Net 8. My knowledge on Azure & DevOps is fairly limited so do excuse my novice level of questioning. The pipeline uses a Hosted Agent. Assuming this agent doesn't have what it needs? Any help would be gratefully appreciated!
j
The installed dotnet sdk depends on the host type, you can specify it directly in the pipeline job. If you are using
windows-latest
it should have dotnet 8: https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md#net-core-tools It is also possible to specify the versions in the stage via a job: https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/use-dotnet-v2?view=azure-pipelines
3 Views