Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-frontends.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 14 additions & 13 deletions .github/workflows/build-ilspy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: false # temp disable due to usage of transport feed for net11

steps:
- run: mkdir -p $env:StagingDirectory
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -120,27 +121,27 @@ 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"
dotnet msbuild ILSpy.VSExtensions.sln /t:Restore /p:Configuration="Release" /p:Platform="Any CPU"
dotnet 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 }})
path: ILSpy.AddIn\bin\${{ matrix.configuration }}\net472\*.vsix
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 }})
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<PackageVersion Include="K4os.Compression.LZ4" Version="1.3.8" />
<PackageVersion Include="McMaster.Extensions.CommandLineUtils" Version="5.0.1" />
<PackageVersion Include="McMaster.Extensions.Hosting.CommandLine" Version="5.0.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="5.3.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic" Version="5.3.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="5.6.0-2.26177.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic" Version="5.6.0-2.26177.1" />
<PackageVersion Include="Microsoft.DiaSymReader.Converter.Xml" Version="1.1.0-beta2-22171-02" />
<PackageVersion Include="Microsoft.DiaSymReader" Version="1.4.0" />
<PackageVersion Include="Microsoft.DiaSymReader.Native" Version="17.0.0-beta1.21524.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net11.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>

Expand Down
36 changes: 32 additions & 4 deletions ICSharpCode.Decompiler.Tests/Helpers/RoslynToolset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,40 @@ 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)
{
this.cache = new SourceCacheContext();
this.repository = Repository.Factory.GetCoreV3("https://api.nuget.org/v3/index.json");
this.resource = repository.GetResource<FindPackageByIdResource>();
this.dotnetToolsFeed = Repository.Factory.GetCoreV3("https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json");
this.dotnetToolsResource = dotnetToolsFeed.GetResource<FindPackageByIdResource>();
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")))
Expand All @@ -70,9 +92,15 @@ protected async Task FetchPackage(string packageName, string version, string sou
{
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,
Expand Down
2 changes: 1 addition & 1 deletion ICSharpCode.Decompiler.Tests/Helpers/Tester.VB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static async Task<CompilerResults> CompileVB(string sourceFileName, Compi
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);
Expand Down
18 changes: 13 additions & 5 deletions ICSharpCode.Decompiler.Tests/Helpers/Tester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ public enum AssemblerOptions

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;

Expand All @@ -108,9 +112,9 @@ static Tester()
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: <Project><ItemGroup><PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0-3.final" />
packagesPropsFile = Path.Combine(TesterPath, "../../../../../Directory.Packages.props");
Expand All @@ -136,6 +140,7 @@ internal static async Task Initialize()
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);
Expand Down Expand Up @@ -341,7 +346,7 @@ private static string ReplacePrivImplDetails(string il)
};

static readonly Dictionary<string, Lazy<string>> targetFrameworkAttributeSnippetFiles = new() {
{ ".NETCoreApp,Version=v10.0", new Lazy<string>(() => GetTargetFrameworkAttributeSnippetFile(".NETCoreApp,Version=v10.0")) },
{ CurrentNetCoreAppVersion, new Lazy<string>(() => GetTargetFrameworkAttributeSnippetFile(CurrentNetCoreAppVersion)) },
{ ".NETCoreApp,Version=v5.0", new Lazy<string>(() => GetTargetFrameworkAttributeSnippetFile(".NETCoreApp,Version=v5.0")) },
{ ".NETCoreApp,Version=v2.2", new Lazy<string>(() => GetTargetFrameworkAttributeSnippetFile(".NETCoreApp,Version=v2.2")) },
};
Expand Down Expand Up @@ -454,12 +459,15 @@ public static List<string> GetPreprocessorSymbols(CompilerOptions flags)
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)
Expand Down Expand Up @@ -520,7 +528,7 @@ public static async Task<CompilerResults> CompileCSharp(string sourceFileName, C
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);
Expand Down Expand Up @@ -770,7 +778,7 @@ public static void CompileCSharpWithPdb(string assemblyName, Dictionary<string,
}

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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<PropertyGroup>
<TargetFramework>net10.0-windows</TargetFramework>
<TargetFramework>net11.0-windows</TargetFramework>
<LangVersion>preview</LangVersion>
<RuntimeIdentifier Condition="$(IsWindowsX64) == true">win-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="$(IsWindowsARM64) == true">win-arm64</RuntimeIdentifier>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<PropertyGroup>
<TargetFramework>net10.0-windows</TargetFramework>
<TargetFramework>net11.0-windows</TargetFramework>
<RuntimeIdentifier Condition="$(IsWindowsX64) == true">win-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="$(IsWindowsARM64) == true">win-arm64</RuntimeIdentifier>

Expand Down
2 changes: 1 addition & 1 deletion ILSpy.Tests/ILSpy.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<PropertyGroup>
<TargetFramework>net10.0-windows</TargetFramework>
<TargetFramework>net11.0-windows</TargetFramework>
<IsPackable>false</IsPackable>
<RuntimeIdentifier Condition="$(IsWindowsX64) == true">win-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="$(IsWindowsARM64) == true">win-arm64</RuntimeIdentifier>
Expand Down
6 changes: 3 additions & 3 deletions ILSpy.sln
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,23 @@
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
<add key="dotnet9-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9-transport/nuget/v3/index.json" />
<add key="dotnet10-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet10-transport/nuget/v3/index.json" />
<add key="dotnet11-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet11-transport/nuget/v3/index.json" />
</packageSources>
<packageSourceMapping>
<packageSource key="nuget.org">
<package pattern="*" />
<package pattern="Microsoft.DiaSymReader.Native" />
<package pattern="Microsoft.DiaSymReader" />
<package pattern="Microsoft.CodeAnalysis.NetAnalyzers" />
</packageSource>
<packageSource key="dotnet10-transport">
<package pattern="ILCompiler.Reflection.ReadyToRun.Experimental" />
</packageSource>
<packageSource key="dotnet-tools">
<package pattern="Microsoft.DiaSymReader.Converter.Xml" />
<package pattern="Microsoft.DiaSymReader.PortablePdb" />
<package pattern="Microsoft.CodeAnalysis.*" />
</packageSource>
</packageSourceMapping>
</configuration>
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "10.0.0",
"version": "11.0.0",
"rollForward": "major",
"allowPrerelease": true
},
Expand Down
Loading