New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Azure DevOps Pipeline doesn't support .NET 7? #7950
Comments
Not sure if below helps however the agents dont appear to have been updated to include dotnet core 7. This usually takes some time after releases. The following YAML should work to install the SDK.
This will then output as
Here is the full pipelines (as a test)
|
@Nico-VanHaaster I added the Use DotNET build step -> it's working now. Many thanks! |
In last year's similar discussion I mentioned that it'd be nice for the pipeline to look at the version within the project instead of having to define it twice (see here: #6907 (comment)). Has any progress been made on that? It seems like it'd stop this from being a yearly issue every November when a new version is released. |
.Net 7 should be part of the Azure DevOps Hosted Agent (20221111.1) Windows 2022 image should be updated soon hopefully. See PR actions/runner-images#6567 |
As a workaround I have been using the UseDotNet@2 task, but it seems to fail more times than it works. I am curious why this wouldn't work 100% of the time.
|
@paulczy probably a new issue is better but I think https://github.com/microsoft/azure-pipelines-tasks/ is the best place for this. We've been using the same task for our pipeline without issues. |
While this does provide a workaround in the interim, it adds a good 1.5mins to all our build pipelines which has a meaningful Any ETA on when the .NET 7 SDK will be included in Pipelines out-of-the-box? Tracking the Azure DevOps release notes (or the Pipelines release notes specifically) there doesn't seem to have been a release since Nov 2, 2022 – before .NET 7 was officially released. |
@marchy It is included already as far as I can tell. https://github.com/actions/runner-images/blob/main/images/win/Windows2022-Readme.md |
@superjulius Fantastic, looks like it's indeed now working! 🎉 Seems like the
still ends up downloading a fresh version of the SDK ("Version 7.0.100 was not found in cache") even though it's a perfect match, thus we never detected the actual VM inclusion despite being on the lookout for it in our builds.
Anyways glad we're past it! Looks like it has gone in the VM on Nov 24 (commit). |
sorry to hijack this thread, but am I reading this right that I don't need to install maui workloads if I'm using windows-2022? i.e. no need to |
This is still an issue. On azure pipelines I get the following: "Error NETSDK1045: The current .NET SDK does not support targeting .NET 7.0. |
My Build Pipe line fails on the nuget restore task in Azure Devops. I set my build agent to: windows-latest
The logging of my build pipe line is as follows:
Detected NuGet version 6.4.0.123 / 6.4.0+da5b9fa1595e212914854a9ff4a18a6759ed4729.da5b9fa1595e212914854a9ff4a18a6759ed4729
C:\hostedtoolcache\windows\NuGet\6.4.0\x64\nuget.exe sources Add -NonInteractive -Name 7cc32ed4-d773-4d44-8aaf-5d1f764362a4 -Source https://marcelbeeker.pkgs.visualstudio.com/613d6b9d-285e-48ec-a9ce-004b0a3321ff/_packaging/7cc32ed4-d773-4d44-8aaf-5d1f764362a4/nuget/v3/index.json -ConfigFile D:\a\1\Nuget\tempNuGet_1800.config
Package source with Name: 7cc32ed4-d773-4d44-8aaf-5d1f764362a4 added successfully.
C:\hostedtoolcache\windows\NuGet\6.4.0\x64\nuget.exe sources Add -NonInteractive -Name NuGetOrg -Source https://api.nuget.org/v3/index.json -ConfigFile D:\a\1\Nuget\tempNuGet_1800.config
Package source with Name: NuGetOrg added successfully.
C:\hostedtoolcache\windows\NuGet\6.4.0\x64\nuget.exe restore D:\a\1\s\SecondMobileApp\SecondMobileApp.sln -Verbosity Detailed -NonInteractive -ConfigFile D:\a\1\Nuget\tempNuGet_1800.config
C:\Program Files\dotnet\sdk\6.0.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 7.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0. [D:\a\1\s\SecondMobileApp\SecondMobileApp.Exceptions\SecondMobileApp.Exceptions.csproj]
NuGet Version: 6.4.0.123
C:\Program Files\dotnet\sdk\6.0.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 7.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0. [D:\a\1\s\SecondMobileApp\SecondMobileApp.Standard.Data\SecondMobileApp.Standard.Data.csproj]
MSBuild auto-detection: using msbuild version '17.3.1.41501' from 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\bin'. Use option -MSBuildVersion to force nuget to use a specific version of MSBuild.
C:\Program Files\dotnet\sdk\6.0.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 7.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0. [D:\a\1\s\SecondMobileApp\SecondMobileApp.Standard.Data.Tests\SecondMobileApp.Standard.Data.Tests.csproj]
MSBuild P2P timeout [ms]: 120000
C:\Program Files\dotnet\sdk\6.0.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 7.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0. [D:\a\1\s\SecondMobileApp\SecondMobileApp.Service\SecondMobileApp.Service.csproj]
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\bin\msbuild.exe "C:\Users\VssAdministrator\AppData\Local\Temp\NuGetScratch\s0oibtaf.fl5.nugetinputs.targets" /t:GenerateRestoreGraphFile /nologo /nr:false /v:q /p:NuGetRestoreTargets="C:\Users\VssAdministrator\AppData\Local\Temp\NuGetScratch\ic1gf4g1.z04.nugetrestore.targets" /p:RestoreUseCustomAfterTargets="True" /p:DisableCheckingDuplicateNuGetItems="True" /p:RestoreTaskAssemblyFile="C:\hostedtoolcache\windows\NuGet\6.4.0\x64\nuget.exe" /p:RestoreSolutionDirectory="D:\a\1\s\SecondMobileApp\" /p:RestoreConfigFile="D:\a\1\Nuget\tempNuGet_1800.config" /p:SolutionDir="D:\a\1\s\SecondMobileApp\" /p:SolutionName="SecondMobileApp"
C:\Program Files\dotnet\sdk\6.0.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 7.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0. [D:\a\1\s\SecondMobileApp\SecondMobileApp.Service.Tests\SecondMobileApp.Service.Tests.csproj]
NuGet.CommandLine.ExitCodeException: Exception of type 'NuGet.CommandLine.ExitCodeException' was thrown.
C:\Program Files\dotnet\sdk\6.0.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 7.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0. [D:\a\1\s\SecondMobileApp\SecondMobileApp.MAUI\SecondMobileApp.MAUI.csproj]
at NuGet.CommandLine.MsBuildUtility.d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.CommandLine.RestoreCommand.d__68.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.CommandLine.RestoreCommand.d__63.MoveNext()
##[error]The nuget command failed with exit code(1) and error(C:\Program Files\dotnet\sdk\6.0.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 7.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0. [D:\a\1\s\SecondMobileApp\SecondMobileApp.Exceptions\SecondMobileApp.Exceptions.csproj]
C:\Program Files\dotnet\sdk\6.0.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 7.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0. [D:\a\1\s\SecondMobileApp\SecondMobileApp.Standard.Data\SecondMobileApp.Standard.Data.csproj]
C:\Program Files\dotnet\sdk\6.0.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 7.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0. [D:\a\1\s\SecondMobileApp\SecondMobileApp.Standard.Data.Tests\SecondMobileApp.Standard.Data.Tests.csproj]
C:\Program Files\dotnet\sdk\6.0.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 7.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0. [D:\a\1\s\SecondMobileApp\SecondMobileApp.Service\SecondMobileApp.Service.csproj]
C:\Program Files\dotnet\sdk\6.0.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 7.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0. [D:\a\1\s\SecondMobileApp\SecondMobileApp.Service.Tests\SecondMobileApp.Service.Tests.csproj]
C:\Program Files\dotnet\sdk\6.0.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 7.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0. [D:\a\1\s\SecondMobileApp\SecondMobileApp.MAUI\SecondMobileApp.MAUI.csproj])
##[error]Packages failed to restore
Finishing: NuGet restore
The text was updated successfully, but these errors were encountered: