Skip to content

.NET 11 for Tests#3695

Draft
christophwille wants to merge 14 commits intomasterfrom
net11
Draft

.NET 11 for Tests#3695
christophwille wants to merge 14 commits intomasterfrom
net11

Conversation

@christophwille
Copy link
Copy Markdown
Member

@christophwille christophwille commented Mar 27, 2026

  • Switch TestRunner and test projects to net11
  • Enable getting Roslyn from transport feed (easily)
  • Disabling VSIX build when using transport feed (RTM deps are not on a transport feed)

Built with preview 2 https://dotnet.microsoft.com/en-us/download/dotnet/11.0

To use the transport feed:

  • in build-ilspy.yml disable VSIX builds
  • in nuget.config, add <package pattern="Microsoft.CodeAnalysis.*" /> to dotnet-tools

Problem: MTP for UseWpf directly/indirectly tests. Solution: switch all test projects to net11.

D:\a\ILSpy\ILSpy\ILSpy.Tests\bin\Release\net10.0-windows\win-x64\ILSpy.Tests.dll (net10.0-windows) Zero tests ran
Exit code: -2147450730
  Error output: You must install or update .NET to run this application.
  
  App: D:\a\ILSpy\ILSpy\ILSpy.Tests\bin\Release\net10.0-windows\win-x64\ILSpy.Tests.exe
  Architecture: x64
  Framework: 'Microsoft.WindowsDesktop.App', version '10.0.0' (x64)
  .NET location: D:\a\_temp\.dotnet
  
  The following frameworks were found:
    11.0.0-preview.2.26159.112 at [D:\a\_temp\.dotnet\shared\Microsoft.WindowsDesktop.App]

Problem: msbuild-related test failures. Solution: switch to runner image with VS2026 (Same issue as the usage of msbuild in the pipeline).

"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild.exe" /nologo /v:minimal /restore /p:OutputPath="D:\a\ILSpy\ILSpy\ILSpy-tests\Mono.Cecil-net45-output" "D:\a\ILSpy\ILSpy\ILSpy-tests\Mono.Cecil-net45-decompiled\Mono.Cecil.csproj"

D:\a\ILSpy\ILSpy\ILSpy-tests\Mono.Cecil-net45-decompiled\Mono.Cecil.csproj : error : Could not resolve SDK "Microsoft.NET.Sdk". Exactly one of the probing messages below indicates why we could not resolve the SDK. Investigate and resolve that message to correctly specify the SDK.
D:\a\ILSpy\ILSpy\ILSpy-tests\Mono.Cecil-net45-decompiled\Mono.Cecil.csproj : error :   Version 11.0.100-preview.2.26159.112 of the .NET SDK requires at least version 18.0.0 of MSBuild. The current available version of MSBuild is 17.14.40.60911. Change the .NET SDK specified in global.json to an older version that requires the MSBuild version currently available.
D:\a\ILSpy\ILSpy\ILSpy-tests\Mono.Cecil-net45-decompiled\Mono.Cecil.csproj : error :   The NuGetSdkResolver did not resolve this SDK because there was no version specified in the project or global.json.
D:\a\ILSpy\ILSpy\ILSpy-tests\Mono.Cecil-net45-decompiled\Mono.Cecil.csproj : error :   MSB4276: The default SDK resolver failed to resolve SDK "Microsoft.NET.Sdk" because directory "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk\Sdk" did not exist.
D:\a\ILSpy\ILSpy\ILSpy-tests\Mono.Cecil-net45-decompiled\Mono.Cecil.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.

Problem: msbuild in the Windows pipeline was acting up, so I had to replace it with dotnet build. Action error for documentation:

Run msbuild ILSpy.sln /p:Configuration=Release /p:Platform=$env:BuildPlatform /m
MSBuild version 17.14.40+3e7442088 for .NET Framework
Build started 3/27/2026 3:07:36 PM.

     1>Project "D:\a\ILSpy\ILSpy\ILSpy.sln" on node 1 (default targets).
     1>ValidateSolutionConfiguration:
         Building solution configuration "Release|Any CPU".
     0>D:\a\ILSpy\ILSpy\ILSpy\ILSpy.csproj : error : Could not resolve SDK "Microsoft.NET.Sdk". Exactly one of the probing messages below indicates why we could not resolve the SDK. Investigate and resolve that message to correctly specify the SDK.
D:\a\ILSpy\ILSpy\ILSpy\ILSpy.csproj : error :   Version 11.0.100-preview.2.26159.112 of the .NET SDK requires at least version 18.0.0 of MSBuild. The current available version of MSBuild is 17.14.40.60911. Change the .NET SDK specified in global.json to an older version that requires the MSBuild version currently available.
D:\a\ILSpy\ILSpy\ILSpy\ILSpy.csproj : error :   The NuGetSdkResolver did not resolve this SDK because there was no version specified in the project or global.json.
D:\a\ILSpy\ILSpy\ILSpy\ILSpy.csproj : error :   MSB4276: The default SDK resolver failed to resolve SDK "Microsoft.NET.Sdk" because directory "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk\Sdk" did not exist.

@christophwille
Copy link
Copy Markdown
Member Author

@Youssef1313 If I may pester you for a second - https://github.com/icsharpcode/ILSpy/actions/runs/23659269195/job/68924889813#step:14:141 there MTP (I guess) complains about the runtime not being there

D:\a\ILSpy\ILSpy\ILSpy.Tests\bin\Release\net10.0-windows\win-x64\ILSpy.Tests.dll (net10.0-windows) Zero tests ran
Exit code: -2147450730
  Error output: You must install or update .NET to run this application.
  
  App: D:\a\ILSpy\ILSpy\ILSpy.Tests\bin\Release\net10.0-windows\win-x64\ILSpy.Tests.exe
  Architecture: x64
  Framework: 'Microsoft.WindowsDesktop.App', version '10.0.0' (x64)
  .NET location: D:\a\_temp\.dotnet
  
  The following frameworks were found:
    11.0.0-preview.2.26159.112 at [D:\a\_temp\.dotnet\shared\Microsoft.WindowsDesktop.App]
  
  The following frameworks for other architectures were found:
    x86
      8.0.25 at [C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App]
      10.0.5 at [C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App]

The third test project works although it targets net10-windows as well... expected behavior, what to change, if bug - where to report properly?

@Youssef1313
Copy link
Copy Markdown
Contributor

Looks like all is green now?

@christophwille
Copy link
Copy Markdown
Member Author

@Youssef1313 Only because I switched the projects to net11 (40f4489).

@Youssef1313
Copy link
Copy Markdown
Contributor

Generally speaking, if you want the test project to target net10 while you use .NET 11 SDK, then you need to install the .NET 10 runtime as well (not necessarily install the .NET 10 SDK - just the runtime).

@christophwille
Copy link
Copy Markdown
Member Author

I started out with the 2025 image and VS2022 on it, and ran into problems with msbuild (but we use that image with our vCurrent builds that target net10 and use MTP). Then I switched over to 2025-vs2026 which has the following software installed https://github.com/actions/runner-images/blob/main/images/windows/Windows2025-VS2026-Readme.md, which includes Microsoft.WindowsDesktop.App: 8.0.6, 8.0.22, 8.0.25, 9.0.6, 9.0.14, 10.0.5. That should have done the trick and lines up with the error message I tagged you with ("10.0.0 needed, 10.0.5 found")

The only thing I can think of that might throw off MTP is our use of DOTNET_ROOT, see

DOTNET_ROOT: ${{ runner.temp }}/.dotnet

@Youssef1313
Copy link
Copy Markdown
Contributor

That use of DOTNET_ROOT might be the cause indeed.

@christophwille christophwille added dependencies Pull requests that update a dependency file .NET Pull requests that update .net code github_actions Pull requests that update GitHub Actions code labels Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file github_actions Pull requests that update GitHub Actions code .NET Pull requests that update .net code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants