diff --git a/.github/workflows/build-frontends.yml b/.github/workflows/build-frontends.yml index 52200d2c8..901673e6e 100644 --- a/.github/workflows/build-frontends.yml +++ b/.github/workflows/build-frontends.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/setup-dotnet@v5 with: - dotnet-version: '10.0.x' + dotnet-version: '11.0.x' dotnet-quality: 'preview' - name: Install dependencies diff --git a/.github/workflows/build-ilspy.yml b/.github/workflows/build-ilspy.yml index 238b6ddfa..fa7d05887 100644 --- a/.github/workflows/build-ilspy.yml +++ b/.github/workflows/build-ilspy.yml @@ -13,14 +13,15 @@ jobs: Build: permissions: packages: write # for dotnet nuget push - runs-on: windows-2025 + runs-on: windows-2025-vs2026 strategy: fail-fast: false matrix: Configuration: [ Debug, Release ] env: BuildPlatform: Any CPU - StagingDirectory: buildartifacts + StagingDirectory: buildartifacts + BuildAndPublishVsix: true steps: - run: mkdir -p $env:StagingDirectory @@ -34,7 +35,7 @@ jobs: - uses: actions/setup-dotnet@v5 with: - dotnet-version: '10.0.x' + dotnet-version: '11.0.x' dotnet-quality: 'preview' env: DOTNET_INSTALL_DIR: ${{ runner.temp }}/.dotnet @@ -63,10 +64,10 @@ jobs: Get-ChildItem Env: | Where-Object {$_.Name -Match "^ILSPY_"} | %{ echo "$($_.Name)=$($_.Value)" } | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append - name: Restore the application - run: msbuild ILSpy.sln /t:Restore /p:RestoreEnablePackagePruning=false /p:Configuration=${{ matrix.configuration }} /p:Platform=$env:BuildPlatform + run: dotnet restore ILSpy.sln /p:RestoreEnablePackagePruning=false /p:Configuration=${{ matrix.configuration }} /p:Platform="$env:BuildPlatform" - name: Build - run: msbuild ILSpy.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=$env:BuildPlatform /m + run: dotnet build ILSpy.sln --no-restore -c ${{ matrix.configuration }} /p:Platform="$env:BuildPlatform" /m - name: Format check run: dotnet-format whitespace --verify-no-changes --verbosity detailed ILSpy.sln @@ -120,19 +121,19 @@ jobs: - name: Build Installer (x64 and arm64, framework-dependent) if: matrix.configuration == 'release' run: | - msbuild ILSpy.Installer.sln /t:Restore /p:Configuration="Release" /p:Platform="Any CPU" - msbuild ILSpy.Installer.sln /p:Configuration="Release" /p:Platform="Any CPU" - msbuild ILSpy.Installer.sln /p:Configuration="Release" /p:Platform="Any CPU" /p:PlatformForInstaller="ARM64" + dotnet msbuild ILSpy.Installer.sln /t:Restore /p:Configuration="Release" /p:Platform="Any CPU" + dotnet msbuild ILSpy.Installer.sln /p:Configuration="Release" /p:Platform="Any CPU" + dotnet msbuild ILSpy.Installer.sln /p:Configuration="Release" /p:Platform="Any CPU" /p:PlatformForInstaller="ARM64" - name: Build VS Extensions (for 2017-2019 and 2022) - if: matrix.configuration == 'release' + if: matrix.configuration == 'release' && env.BuildAndPublishVsix == 'true' run: | msbuild ILSpy.VSExtensions.sln /t:Restore /p:Configuration="Release" /p:Platform="Any CPU" msbuild ILSpy.VSExtensions.sln /p:Configuration="Release" /p:Platform="Any CPU" # https://github.com/actions/upload-artifact - name: Upload VSIX (VS 2019) release build artifacts - if: matrix.configuration == 'release' + if: matrix.configuration == 'release' && env.BuildAndPublishVsix == 'true' uses: actions/upload-artifact@v7 with: name: ILSpy VS Addin for VS 2017-2019 ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (${{ matrix.configuration }}) @@ -140,7 +141,7 @@ jobs: if-no-files-found: error - name: Upload VSIX (VS 2022) release build artifacts - if: matrix.configuration == 'release' + if: matrix.configuration == 'release' && env.BuildAndPublishVsix == 'true' uses: actions/upload-artifact@v7 with: name: ILSpy VS Addin for VS 2022 ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (${{ matrix.configuration }}) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index f6b23317f..31aa67975 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -37,7 +37,7 @@ jobs: - uses: actions/setup-dotnet@v5 with: - dotnet-version: '10.0.x' + dotnet-version: '11.0.x' dotnet-quality: 'preview' - name: Build diff --git a/Directory.Packages.props b/Directory.Packages.props index 8fb2876ba..7bc503f1b 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -15,8 +15,8 @@ - - + + diff --git a/ICSharpCode.Decompiler.TestRunner/ICSharpCode.Decompiler.TestRunner.csproj b/ICSharpCode.Decompiler.TestRunner/ICSharpCode.Decompiler.TestRunner.csproj index f9929d13f..795cebecf 100644 --- a/ICSharpCode.Decompiler.TestRunner/ICSharpCode.Decompiler.TestRunner.csproj +++ b/ICSharpCode.Decompiler.TestRunner/ICSharpCode.Decompiler.TestRunner.csproj @@ -2,7 +2,7 @@ Exe - net10.0 + net11.0 enable diff --git a/ICSharpCode.Decompiler.Tests/Helpers/RoslynToolset.cs b/ICSharpCode.Decompiler.Tests/Helpers/RoslynToolset.cs index 0cf476717..5718fbbb1 100644 --- a/ICSharpCode.Decompiler.Tests/Helpers/RoslynToolset.cs +++ b/ICSharpCode.Decompiler.Tests/Helpers/RoslynToolset.cs @@ -41,8 +41,8 @@ namespace ICSharpCode.Decompiler.Tests.Helpers abstract class AbstractToolset { readonly SourceCacheContext cache; - readonly SourceRepository repository; - readonly FindPackageByIdResource resource; + readonly SourceRepository repository, dotnetToolsFeed; + readonly FindPackageByIdResource resource, dotnetToolsResource; protected readonly string baseDir; public AbstractToolset(string baseDir) @@ -50,9 +50,31 @@ namespace ICSharpCode.Decompiler.Tests.Helpers this.cache = new SourceCacheContext(); this.repository = Repository.Factory.GetCoreV3("https://api.nuget.org/v3/index.json"); this.resource = repository.GetResource(); + this.dotnetToolsFeed = Repository.Factory.GetCoreV3("https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json"); + this.dotnetToolsResource = dotnetToolsFeed.GetResource(); this.baseDir = baseDir; } + enum PackageVersionKind + { + Rtm, + Preview, + TransportFeed, + } + + // RTM versions look like 5.3.0, and preview ones like 4.12.0-3.final. Transport feed ones eg 5.6.0-2.26177.1 + static PackageVersionKind ClassifyVersion(NuGetVersion version) + { + if (!version.IsPrerelease) + return PackageVersionKind.Rtm; + + var labels = version.ReleaseLabels.ToList(); + bool looksLikeTransportFeed = labels.Count >= 3 + && labels.All(static label => int.TryParse(label, out _)); + + return looksLikeTransportFeed ? PackageVersionKind.TransportFeed : PackageVersionKind.Preview; + } + protected async Task FetchPackage(string packageName, string version, string sourcePath, string outputPath) { if (!Directory.Exists(Path.Combine(Roundtrip.RoundtripAssembly.TestDir, "nuget"))) @@ -70,9 +92,15 @@ namespace ICSharpCode.Decompiler.Tests.Helpers { packageStream = new MemoryStream(); - await resource.CopyNupkgToStreamAsync( + NuGetVersion parsedVersion = NuGetVersion.Parse(version); + PackageVersionKind versionKind = ClassifyVersion(parsedVersion); + FindPackageByIdResource selectedResource = versionKind == PackageVersionKind.TransportFeed + ? dotnetToolsResource + : resource; + + await selectedResource.CopyNupkgToStreamAsync( packageName, - NuGetVersion.Parse(version), + parsedVersion, packageStream, cache, logger, diff --git a/ICSharpCode.Decompiler.Tests/Helpers/Tester.VB.cs b/ICSharpCode.Decompiler.Tests/Helpers/Tester.VB.cs index 98ceeb38e..73801bdfc 100644 --- a/ICSharpCode.Decompiler.Tests/Helpers/Tester.VB.cs +++ b/ICSharpCode.Decompiler.Tests/Helpers/Tester.VB.cs @@ -53,7 +53,7 @@ namespace ICSharpCode.Decompiler.Tests.Helpers CompilerOptions.UseRoslyn1_3_2 => ("1.3.2", "14", null), CompilerOptions.UseRoslyn2_10_0 => ("2.10.0", "latest", targetNet40 ? null : ".NETCoreApp,Version=v2.2"), CompilerOptions.UseRoslyn3_11_0 => ("3.11.0", "latest", targetNet40 ? null : ".NETCoreApp,Version=v5.0"), - _ => (roslynLatestVersion, flags.HasFlag(CompilerOptions.Preview) ? "preview" : "latest", targetNet40 ? null : ".NETCoreApp,Version=v10.0") + _ => (roslynLatestVersion, flags.HasFlag(CompilerOptions.Preview) ? "preview" : "latest", targetNet40 ? null : CurrentNetCoreAppVersion) }; var vbcPath = roslynToolset.GetVBCompiler(roslynVersion); diff --git a/ICSharpCode.Decompiler.Tests/Helpers/Tester.cs b/ICSharpCode.Decompiler.Tests/Helpers/Tester.cs index 173128035..b7e518589 100644 --- a/ICSharpCode.Decompiler.Tests/Helpers/Tester.cs +++ b/ICSharpCode.Decompiler.Tests/Helpers/Tester.cs @@ -93,6 +93,10 @@ namespace ICSharpCode.Decompiler.Tests.Helpers public static partial class Tester { + public const string CurrentNetCoreVersion = "11.0"; + public const string CurrentNetCoreAppVersion = ".NETCoreApp,Version=v11.0"; + public const string CurrentNetCoreRefAsmVersion = "11.0.0-preview.2.26159.112"; + public static readonly string TesterPath; public static readonly string TestCasePath; @@ -108,9 +112,9 @@ namespace ICSharpCode.Decompiler.Tests.Helpers TesterPath = Path.GetDirectoryName(typeof(Tester).Assembly.Location); TestCasePath = Path.Combine(TesterPath, "../../../../TestCases"); #if DEBUG - testRunnerBasePath = Path.Combine(TesterPath, "../../../../../ICSharpCode.Decompiler.TestRunner/bin/Debug/net10.0"); + testRunnerBasePath = Path.Combine(TesterPath, $"../../../../../ICSharpCode.Decompiler.TestRunner/bin/Debug/net{CurrentNetCoreVersion}"); #else - testRunnerBasePath = Path.Combine(TesterPath, "../../../../../ICSharpCode.Decompiler.TestRunner/bin/Release/net10.0"); + testRunnerBasePath = Path.Combine(TesterPath, $"../../../../../ICSharpCode.Decompiler.TestRunner/bin/Release/net{CurrentNetCoreVersion}"); #endif // To parse: packagesPropsFile = Path.Combine(TesterPath, "../../../../../Directory.Packages.props"); @@ -136,6 +140,7 @@ namespace ICSharpCode.Decompiler.Tests.Helpers await vswhereToolset.Fetch().ConfigureAwait(false); await RefAssembliesToolset.Fetch("5.0.0", sourcePath: "ref/net5.0").ConfigureAwait(false); await RefAssembliesToolset.Fetch("10.0.0", sourcePath: "ref/net10.0").ConfigureAwait(false); + await RefAssembliesToolset.Fetch(CurrentNetCoreRefAsmVersion, sourcePath: $"ref/net{CurrentNetCoreVersion}").ConfigureAwait(false); #if DEBUG await BuildTestRunner("win-x86", "Debug").ConfigureAwait(false); @@ -341,7 +346,7 @@ namespace ICSharpCode.Decompiler.Tests.Helpers }; static readonly Dictionary> targetFrameworkAttributeSnippetFiles = new() { - { ".NETCoreApp,Version=v10.0", new Lazy(() => GetTargetFrameworkAttributeSnippetFile(".NETCoreApp,Version=v10.0")) }, + { CurrentNetCoreAppVersion, new Lazy(() => GetTargetFrameworkAttributeSnippetFile(CurrentNetCoreAppVersion)) }, { ".NETCoreApp,Version=v5.0", new Lazy(() => GetTargetFrameworkAttributeSnippetFile(".NETCoreApp,Version=v5.0")) }, { ".NETCoreApp,Version=v2.2", new Lazy(() => GetTargetFrameworkAttributeSnippetFile(".NETCoreApp,Version=v2.2")) }, }; @@ -454,12 +459,15 @@ namespace System.Runtime.CompilerServices preprocessorSymbols.Add("NET80"); preprocessorSymbols.Add("NET90"); preprocessorSymbols.Add("NET100"); + preprocessorSymbols.Add("NET110"); } preprocessorSymbols.Add("ROSLYN4"); preprocessorSymbols.Add("CS100"); preprocessorSymbols.Add("CS110"); preprocessorSymbols.Add("CS120"); preprocessorSymbols.Add("CS130"); + preprocessorSymbols.Add("CS140"); + preprocessorSymbols.Add("CS150"); } } else if ((flags & CompilerOptions.UseMcsMask) != 0) @@ -520,7 +528,7 @@ namespace System.Runtime.CompilerServices CompilerOptions.UseRoslyn1_3_2 => ("1.3.2", "6", null), CompilerOptions.UseRoslyn2_10_0 => ("2.10.0", "latest", targetNet40 ? null : ".NETCoreApp,Version=v2.2"), CompilerOptions.UseRoslyn3_11_0 => ("3.11.0", "latest", targetNet40 ? null : ".NETCoreApp,Version=v5.0"), - _ => (roslynLatestVersion, flags.HasFlag(CompilerOptions.Preview) ? "preview" : "latest", targetNet40 ? null : ".NETCoreApp,Version=v10.0") + _ => (roslynLatestVersion, flags.HasFlag(CompilerOptions.Preview) ? "preview" : "latest", targetNet40 ? null : CurrentNetCoreAppVersion) }; var cscPath = roslynToolset.GetCSharpCompiler(roslynVersion); @@ -770,7 +778,7 @@ namespace System.Runtime.CompilerServices } var compilation = CSharpCompilation.Create(Path.GetFileNameWithoutExtension(assemblyName), - syntaxTrees, coreDefaultReferences.Select(r => MetadataReference.CreateFromFile(Path.Combine(RefAssembliesToolset.GetPath(".NETCoreApp,Version=v10.0"), r))), + syntaxTrees, coreDefaultReferences.Select(r => MetadataReference.CreateFromFile(Path.Combine(RefAssembliesToolset.GetPath(CurrentNetCoreAppVersion), r))), new CSharpCompilationOptions( OutputKind.DynamicallyLinkedLibrary, platform: Platform.AnyCpu, diff --git a/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj b/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj index c34847739..8d1d26f7d 100644 --- a/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj +++ b/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj @@ -7,7 +7,7 @@ - net10.0-windows + net11.0-windows preview win-x64 win-arm64 diff --git a/ILSpy.AddIn.VS2022/NuGet.config b/ILSpy.AddIn.VS2022/NuGet.config new file mode 100644 index 000000000..d225cff49 --- /dev/null +++ b/ILSpy.AddIn.VS2022/NuGet.config @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/ILSpy.AddIn/NuGet.config b/ILSpy.AddIn/NuGet.config new file mode 100644 index 000000000..c3f2731d1 --- /dev/null +++ b/ILSpy.AddIn/NuGet.config @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/ILSpy.BamlDecompiler.Tests/ILSpy.BamlDecompiler.Tests.csproj b/ILSpy.BamlDecompiler.Tests/ILSpy.BamlDecompiler.Tests.csproj index 59275ab45..b966a2f49 100644 --- a/ILSpy.BamlDecompiler.Tests/ILSpy.BamlDecompiler.Tests.csproj +++ b/ILSpy.BamlDecompiler.Tests/ILSpy.BamlDecompiler.Tests.csproj @@ -7,7 +7,7 @@ - net10.0-windows + net11.0-windows win-x64 win-arm64 diff --git a/ILSpy.Tests/ILSpy.Tests.csproj b/ILSpy.Tests/ILSpy.Tests.csproj index 05382fc29..0e3b2d737 100644 --- a/ILSpy.Tests/ILSpy.Tests.csproj +++ b/ILSpy.Tests/ILSpy.Tests.csproj @@ -7,7 +7,7 @@ - net10.0-windows + net11.0-windows false win-x64 win-arm64 diff --git a/ILSpy.sln b/ILSpy.sln index dd9dfdd8e..cc84420d0 100644 --- a/ILSpy.sln +++ b/ILSpy.sln @@ -1,7 +1,6 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.32014.148 +# Visual Studio Version 18 +VisualStudioVersion = 18.4.11620.152 stable MinimumVisualStudioVersion = 15.0 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{F45DB999-7E72-4000-B5AD-3A7B485A0896}" ProjectSection(SolutionItems) = preProject @@ -42,6 +41,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Directory.Build.props = Directory.Build.props Directory.Packages.props = Directory.Packages.props global.json = global.json + NuGet.config = NuGet.config EndProjectSection EndProject Global diff --git a/NuGet.config b/NuGet.config index c7d27132e..63c7aff7b 100644 --- a/NuGet.config +++ b/NuGet.config @@ -4,14 +4,15 @@ - + + @@ -19,6 +20,7 @@ + diff --git a/global.json b/global.json index 91af2aeac..115ca7301 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "10.0.0", + "version": "11.0.0", "rollForward": "major", "allowPrerelease": true },