actions / runner-images

GitHub Actions runner images
MIT License
10.1k stars 3.04k forks source link

[Ask: Upgrade VS to 17.10] Latest Windows 2022 Runner Image Doesn't Support .Net 8 Analyzers #9965

Closed jack-work closed 4 months ago

jack-work commented 4 months ago

Description

Our project has tasks that run Rosyln\csc.exe from the Visual Studio 2022 instance on Azure DevOps agents that use the Windows 2022 image in this repository. The version of csc.exe that VS 17.9 is using does not seem to support .Net 8 / compiler version 4.10. We are met with the following error message when the agent runs csc.exe:

[error]CSC(0,0): Error CS9057: The analyzer assembly 'C:\hostedtoolcache\windows\dotnet\sdk\8.0.300\Sdks\Microsoft.NET.Sdk\codestyle\cs\Microsoft.CodeAnalysis.CodeStyle.dll' references version '4.10.0.0' of the compiler, which is newer than the currently running version '4.9.0.0'.

This only seems to happen during the build of one of our test projects and I'm trying to see if I can maybe remove the dependency. But upgrading to VS 17.10 locally resolved this issue for me and my collaborators and I expect the same is the case when upgrading the build machines.

Glad to provide more info on request.

Platforms affected

Runner images affected

Image version and build link

Current agent version: '3.238.0' Operating System Runner Image 1ES Hosted Pool Current image version: '20240514.3.0'

I doubt y'all have access to these logs though. https://msazure.visualstudio.com/OneAgile/_build/results?buildId=94595365&view=logs&j=af5e600d-6810-551d-2bbd-7e7d98bd0ff1&t=dafd72d2-3357-4946-ae5a-c0d1a56a9c1a

Is it regression?

No, upgrade to .Net 8 blocked

Expected behavior

Project can use csc.exe analyzer successfully and allow build to continue

Actual behavior

csc.exe fails citing that the version of the compiler in the Visual Studio msbuild SDK folder does not support the compiler version specified by the target framework, .Net 8

Repro steps

  1. Run C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Roslyn\csc.exe /noconfig from a machined imaged with Windows 2022 in the GH actions repo on a project that targets .Net 8

Expected: csc.exe completes successfully Actual: csc.exe fails with compiler version mismatch issue, if certain rules are encountered. Note that we're not sure under what conditions the issue is encountered, as it's happening for only one of many projects that are built by the pipeline with this image.

gdryke commented 4 months ago

Pulling out the core ask based on side conversation, taking VS from 17.09 to 17.10 should fix this issue.

mikhailkoliada commented 4 months ago

should be deployed