-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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 6? (VS2019 on windows-latest pool) #6907
Comments
@richlander who would know about what's supported on the latest images? I am using vmImage: windows-2022 on my pipeline with .NET 6 SDK and that works for me. I haven't tried with windows-latest yet to see if it would work for me as well. I can give it a try and report back. |
@mairaw Thank you, if I switch to It would be fine, if the |
I'm trying to find the owner for this so we can have a definitive answer. |
That'd be great. The UseDotNet task worked for me, but I'd much rather define that I'm using .net 6 in one place (within the project, not also in the pipeline) and for everything else to reference that. |
VS 2019 (windows) does not support .NET 6, for example as per the downloads page of the .NET 6 SDK:
How are you building your applicaton? If you use the
This is likely not related to the build image. Does an equivalent |
Ok, I found this page now Microsoft-hosted agents with the installed software on the different hosts.
I didn't expect, that the "windows-latest" is no the latest ... :( (clean code: meaningful names?) With that info it's clear. And your are right, I got the NETSDK1152 error also on a local publish. (I changed the target framework, fixed the bugs, run the tests and than I tried directly the pipeline.) There was an obsolete appsettings.json file in a second project. With that I run into the next error during the test execution in the pipeline:
I didn't set "vsTestVersion" which should use again the "latest" Version. But it looks for a
|
Setting |
Good to hear about your progress! personally I‘m mostly using the DotNetCLI task as well to run tests and publish result (works for SDK-based test projects) |
I fixed it adding this to yaml file:
It works with:
|
But you don't use VSBuild or VSTest Task, do you? |
I agree that this works, and I'm grateful for it. It'd also be nice to have a more permanent fix. This won't work if there's a .net 6.1, or when .net 7 comes out. |
I use |
Imao .NET 6 SDK should be added to It is marked as recommended when downloading .NET and it is the current Long-term support (LTS) version. |
As long as the latest image is the Windows Server 2019 with Visual Studio 2019 it wouldn't help in all cases, for example VSTasks won't run, because .NET 6 needs VS 2022. The latest image should always be the lastest and not the second latest. |
What is microsoft doing? Why is |
I remember when .Net 5.0 was released, it also did't work without |
i have the same error |
I have the same problem With vmImage: 'windows-latest' it doesnt work even using DotNetCoreCLI@2 |
So at this point Here is a working pipeline that I pulled from these 2 blog posts: This is a fully working Azure DevOps pipeline for a .NET 6.0 project using C# 10.0: # ASP.NET Core (.NET Framework)
# Build and test ASP.NET Core projects targeting the full .NET Framework.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
- master
pool:
vmImage: 'windows-2022'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
# Add this Command to Include the .NET 6 SDK
- task: UseDotNet@2
displayName: Use .NET 6.0
inputs:
packageType: 'sdk'
version: '6.0.x'
# Add a Command To List the Current .NET SDKs (Sanity Check)
- task: CmdLine@2
inputs:
script: 'dotnet --list-sdks'
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: VSBuild@1
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)' |
(disclaimer: not working for MS/GH, this comes from experience following the updates for a quite a while) New images are usually tested for a few months to make sure people starting to use it (like all of us) don't run into unexpected issues in build scripts. That means waiting to see if people migrating to VS 2022 / .NET 6 / * open issues for something not working. Then default image changes are rolled out incrementally - monitoring build failures and tickets. Again, you don't want to break thousands of people by changing the defaults unexpectedly and without prior notice. I too would be happy to not wake up the whole company being unable to complete work due to stuck CI/CD builds just because VS 2022 came out and most projects are still on .NET 3.1 LTS / VS2019 and not being updated on Day 0. If you are asking for changing From actions/runner-images#4488:
|
Thanks to @dasMulli for the info. The behaviour that you discribe, would I expect if I use something like |
I followed up internally on this as well. Here's the response I got: "It is a long process for us to update the windows-latest label to point to the latest Windows image. The moment we do this, we break a number of customers. So, when we release a new image like windows-2022, we give a long notice (about 3-4 months), wait for people to gradually move their builds, and then update the image label. FYI, windows-latest pointed to windows-2016 until 3 months ago. You can follow the shifts in these labels from our release notes and from the GitHub pages. Release notes: https://docs.microsoft.com/en-us/azure/devops/release-notes/2021/sprint-194-update Sample item in release notes about latest image: https://docs.microsoft.com/en-us/azure/devops/release-notes/2021/sprint-193-update#macos-latest-label-will-soon-point-to-macos-11-image" I'd keep an eye on the Microsoft-hosted agents article for updates. But for now, the windows-2022 is the right one to use. Closing this issue since this behavior is by design according to the product team. |
As others have already pointed out, should the name really be The reasons for why a switch can't happen over night make sense, but the name is still extremely misleading. Especially for people who set up a new project. I concur with others here that |
@EnCey suggest you open that as in issue on https://github.com/actions/virtual-environments |
Use .NET 6.0 SDK --> Takes 1.30minute. Are there any options to improve this? |
If you select |
Hmm, didn't work on my end. It still took some time to download & install the SDK. Ended up using ubuntu to speed it up. Seems a bit weird that this is faster than a windows image? |
Sorry, but this is nonsense: customers that choose to use the Stop mollycoddling developers who are too lazy to setup build and release pipelines correctly. |
Here's the issue tracking this update: actions/runner-images#4856 |
Hitting the same issue here as well |
While I agree to an extent, I want to counter with the fact that this implicitly codifies the notion that Developers and DevOps should not be distinct from one another, and that Developers need to know literally everything to do literally anything, which is a death spiral. I'm running into this upgrading to .NET 6 when I've literally never had to interact with this aspect of Azure DevOps for my 5 years of experience with it. I do otherwise agree that "latest" is "latest", and that they should have a different keyword if you want "latest-verified"
✋ |
I'd suggest that you start a discussion on the https://github.com/actions/virtual-environments repo about this. This is not something the .NET team controls it. |
@brendansluke Your pipeline example worked perfectly. Thank you for sharing! |
Update Agent Specification in Azure DevOps pipeline to Windows 2022, Working fine after that!!! |
Yes it's working. |
Description
I upgraded my project from .NET 5 to .NET 6 and wanted to execute a "build, test and publish" pipeline on Azure DevOps. That fails because the hosted agent does not support .NET 6 by default.
I added an UseDotNet task in order to install the .NET 6 SDK which works, but that the build task failed ...
telling me, that Visual Studio 2019 does not support .NET 6.
I tried to set the "Compatible Visual Studio version", but than seems to be ignored:
I would expect, that after the official release of .NET 6 the "latest" hosted agents would also support this new version.
Configuration
Regression?
Other information
The text was updated successfully, but these errors were encountered: