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
[X] Azure DevOps
[ ] GitHub Actions - Standard Runners
[ ] GitHub Actions - Larger Runners
Runner images affected
[ ] Ubuntu 20.04
[ ] Ubuntu 22.04
[ ] Ubuntu 24.04
[ ] macOS 11
[ ] macOS 12
[ ] macOS 13
[ ] macOS 13 Arm64
[ ] macOS 14
[ ] macOS 14 Arm64
[ ] Windows Server 2019
[X] Windows Server 2022
Image version and build link
Current agent version: '3.238.0'
Operating System
Runner Image
1ES Hosted Pool
Current image version: '20240514.3.0'
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
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.
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
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.