From a1b9aa12e7aca101227ff95053d237ab369f4b55 Mon Sep 17 00:00:00 2001 From: ds5678 <49847914+ds5678@users.noreply.github.com> Date: Mon, 31 Mar 2025 18:45:21 -0700 Subject: [PATCH 1/4] Support params keyword on non-array collections --- .../Helpers/Tester.cs | 3 ++- .../ICSharpCode.Decompiler.Tests.csproj | 4 +++- .../PrettyTestRunner.cs | 6 +++++ .../TestCases/Pretty/ParamsCollections.cs | 21 ++++++++++++++++ .../CSharp/CSharpLanguageVersion.cs | 3 ++- .../Transforms/EscapeInvalidIdentifiers.cs | 1 + ICSharpCode.Decompiler/DecompilerSettings.cs | 24 +++++++++++++++++++ .../TypeSystem/DecompilerTypeSystem.cs | 11 ++++++++- .../Implementation/AttributeListBuilder.cs | 3 +++ .../Implementation/KnownAttributes.cs | 2 ++ .../Implementation/MetadataParameter.cs | 18 +++++++++++--- ILSpy/Languages/CSharpLanguage.cs | 1 + ILSpy/Properties/Resources.Designer.cs | 19 +++++++-------- ILSpy/Properties/Resources.resx | 3 +++ ILSpy/Properties/Resources.zh-Hans.resx | 3 +++ 15 files changed, 105 insertions(+), 17 deletions(-) create mode 100644 ICSharpCode.Decompiler.Tests/TestCases/Pretty/ParamsCollections.cs diff --git a/ICSharpCode.Decompiler.Tests/Helpers/Tester.cs b/ICSharpCode.Decompiler.Tests/Helpers/Tester.cs index ed9e2739f7..7d7e33f8f6 100644 --- a/ICSharpCode.Decompiler.Tests/Helpers/Tester.cs +++ b/ICSharpCode.Decompiler.Tests/Helpers/Tester.cs @@ -421,6 +421,7 @@ public static List GetPreprocessorSymbols(CompilerOptions flags) preprocessorSymbols.Add("CS100"); preprocessorSymbols.Add("CS110"); preprocessorSymbols.Add("CS120"); + preprocessorSymbols.Add("CS130"); } } else if ((flags & CompilerOptions.UseMcsMask) != 0) @@ -639,7 +640,7 @@ internal static DecompilerSettings GetSettings(CompilerOptions cscOptions) CompilerOptions.UseRoslyn1_3_2 => CSharp.LanguageVersion.CSharp6, CompilerOptions.UseRoslyn2_10_0 => CSharp.LanguageVersion.CSharp7_3, CompilerOptions.UseRoslyn3_11_0 => CSharp.LanguageVersion.CSharp9_0, - _ => cscOptions.HasFlag(CompilerOptions.Preview) ? CSharp.LanguageVersion.Latest : CSharp.LanguageVersion.CSharp12_0, + _ => cscOptions.HasFlag(CompilerOptions.Preview) ? CSharp.LanguageVersion.Latest : CSharp.LanguageVersion.CSharp13_0, }; DecompilerSettings settings = new(langVersion) { // Never use file-scoped namespaces diff --git a/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj b/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj index e6053e5587..e7a9f4e611 100644 --- a/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj +++ b/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj @@ -8,6 +8,7 @@ net8.0-windows + 13 win-x64 win-arm64 @@ -17,7 +18,7 @@ True 1701;1702;1705,67,169,1058,728,1720,649,168,251,660,661,675;1998;162;8632;626;8618;8714;8602;8981 - ROSLYN;ROSLYN2;ROSLYN3;ROSLYN4;NET60;CS60;CS70;CS71;CS72;CS73;CS80;CS90;CS100;CS110;CS120 + ROSLYN;ROSLYN2;ROSLYN3;ROSLYN4;NET60;CS60;CS70;CS71;CS72;CS73;CS80;CS90;CS100;CS110;CS120;CS130 False False @@ -141,6 +142,7 @@ + diff --git a/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs b/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs index 9b4184aa72..dd0b1a3c58 100644 --- a/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs +++ b/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs @@ -598,6 +598,12 @@ public async Task ConstantsTests([ValueSource(nameof(defaultOptions))] CompilerO await RunForLibrary(cscOptions: cscOptions); } + [Test] + public async Task ParamsCollections([ValueSource(nameof(roslyn4OrNewerOptions))] CompilerOptions cscOptions) + { + await RunForLibrary(cscOptions: cscOptions); + } + [Test] public async Task Issue1080([ValueSource(nameof(roslynOnlyOptions))] CompilerOptions cscOptions) { diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ParamsCollections.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ParamsCollections.cs new file mode 100644 index 0000000000..69b0aa2e89 --- /dev/null +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ParamsCollections.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; + +namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty +{ + public static class ParamsCollections + { + public static void ParamsEnumerable(params IEnumerable values) + { + } + public static void ParamsList(params List values) + { + } + public static void ParamsReadOnlySpan(params ReadOnlySpan values) + { + } + public static void ParamsSpan(params Span values) + { + } + } +} diff --git a/ICSharpCode.Decompiler/CSharp/CSharpLanguageVersion.cs b/ICSharpCode.Decompiler/CSharp/CSharpLanguageVersion.cs index 019774580c..65e7fdceb4 100644 --- a/ICSharpCode.Decompiler/CSharp/CSharpLanguageVersion.cs +++ b/ICSharpCode.Decompiler/CSharp/CSharpLanguageVersion.cs @@ -35,7 +35,8 @@ public enum LanguageVersion CSharp10_0 = 1000, CSharp11_0 = 1100, CSharp12_0 = 1200, - Preview = 1100, + CSharp13_0 = 1300, + Preview = 1300, Latest = 0x7FFFFFFF } } diff --git a/ICSharpCode.Decompiler/CSharp/Transforms/EscapeInvalidIdentifiers.cs b/ICSharpCode.Decompiler/CSharp/Transforms/EscapeInvalidIdentifiers.cs index 907fb807ff..288e4d08df 100644 --- a/ICSharpCode.Decompiler/CSharp/Transforms/EscapeInvalidIdentifiers.cs +++ b/ICSharpCode.Decompiler/CSharp/Transforms/EscapeInvalidIdentifiers.cs @@ -166,6 +166,7 @@ public class RemoveEmbeddedAttributes : DepthFirstAstVisitor, IAstTransform "System.Runtime.CompilerServices.NullableAttribute", "System.Runtime.CompilerServices.NullableContextAttribute", "System.Runtime.CompilerServices.NativeIntegerAttribute", + "System.Runtime.CompilerServices.ParamCollectionAttribute", "System.Runtime.CompilerServices.RefSafetyRulesAttribute", "System.Runtime.CompilerServices.ScopedRefAttribute", "System.Runtime.CompilerServices.RequiresLocationAttribute", diff --git a/ICSharpCode.Decompiler/DecompilerSettings.cs b/ICSharpCode.Decompiler/DecompilerSettings.cs index a0bd68f366..6a1645bac7 100644 --- a/ICSharpCode.Decompiler/DecompilerSettings.cs +++ b/ICSharpCode.Decompiler/DecompilerSettings.cs @@ -165,10 +165,16 @@ public void SetLanguageVersion(CSharp.LanguageVersion languageVersion) refReadOnlyParameters = false; usePrimaryConstructorSyntaxForNonRecordTypes = false; } + if (languageVersion < CSharp.LanguageVersion.CSharp13_0) + { + paramsCollections = false; + } } public CSharp.LanguageVersion GetMinimumRequiredVersion() { + if (paramsCollections) + return CSharp.LanguageVersion.CSharp13_0; if (refReadOnlyParameters || usePrimaryConstructorSyntaxForNonRecordTypes) return CSharp.LanguageVersion.CSharp12_0; if (scopedRef || requiredMembers || numericIntPtr || utf8StringLiterals || unsignedRightShift || checkedOperators) @@ -848,6 +854,24 @@ public bool ForEachWithGetEnumeratorExtension { } } + bool paramsCollections = true; + + /// + /// Support params collections. + /// + [Category("C# 13.0 / VS 2022.12")] + [Description("DecompilerSettings.DecompileParamsCollections")] + public bool ParamsCollections { + get { return paramsCollections; } + set { + if (paramsCollections != value) + { + paramsCollections = value; + OnPropertyChanged(); + } + } + } + bool lockStatement = true; /// diff --git a/ICSharpCode.Decompiler/TypeSystem/DecompilerTypeSystem.cs b/ICSharpCode.Decompiler/TypeSystem/DecompilerTypeSystem.cs index fa849ef9ad..03feb0f0d7 100644 --- a/ICSharpCode.Decompiler/TypeSystem/DecompilerTypeSystem.cs +++ b/ICSharpCode.Decompiler/TypeSystem/DecompilerTypeSystem.cs @@ -138,12 +138,19 @@ public enum TypeSystemOptions /// RefReadOnlyParameters = 0x10000, /// + /// If this option is active, [ParamCollectionAttribute] on parameters is removed + /// and parameters are marked as params. + /// Otherwise, the attribute is preserved but the parameters are not marked + /// as if it was a normal parameter without any attributes. + /// + ParamsCollections = 0x20000, + /// /// Default settings: typical options for the decompiler, with all C# languages features enabled. /// Default = Dynamic | Tuple | ExtensionMethods | DecimalConstants | ReadOnlyStructsAndParameters | RefStructs | UnmanagedConstraints | NullabilityAnnotations | ReadOnlyMethods | NativeIntegers | FunctionPointers | ScopedRef | NativeIntegersWithoutAttribute - | RefReadOnlyParameters + | RefReadOnlyParameters | ParamsCollections } /// @@ -185,6 +192,8 @@ public static TypeSystemOptions GetOptions(DecompilerSettings settings) typeSystemOptions |= TypeSystemOptions.NativeIntegersWithoutAttribute; if (settings.RefReadOnlyParameters) typeSystemOptions |= TypeSystemOptions.RefReadOnlyParameters; + if (settings.ParamsCollections) + typeSystemOptions |= TypeSystemOptions.ParamsCollections; return typeSystemOptions; } diff --git a/ICSharpCode.Decompiler/TypeSystem/Implementation/AttributeListBuilder.cs b/ICSharpCode.Decompiler/TypeSystem/Implementation/AttributeListBuilder.cs index 66d77a7357..15624ab989 100644 --- a/ICSharpCode.Decompiler/TypeSystem/Implementation/AttributeListBuilder.cs +++ b/ICSharpCode.Decompiler/TypeSystem/Implementation/AttributeListBuilder.cs @@ -258,6 +258,9 @@ internal bool IgnoreAttribute(TopLevelTypeName attributeType, SymbolKind target) case "RequiresLocationAttribute": return (options & TypeSystemOptions.RefReadOnlyParameters) != 0 && (target == SymbolKind.Parameter); + case "ParamCollectionAttribute": + return (options & TypeSystemOptions.ParamsCollections) != 0 + && (target == SymbolKind.Parameter); default: return false; } diff --git a/ICSharpCode.Decompiler/TypeSystem/Implementation/KnownAttributes.cs b/ICSharpCode.Decompiler/TypeSystem/Implementation/KnownAttributes.cs index 59d2c19eb4..ce4a305e52 100644 --- a/ICSharpCode.Decompiler/TypeSystem/Implementation/KnownAttributes.cs +++ b/ICSharpCode.Decompiler/TypeSystem/Implementation/KnownAttributes.cs @@ -87,6 +87,7 @@ public enum KnownAttribute // Parameter attributes: ParamArray, + ParamCollection, In, Out, Optional, @@ -166,6 +167,7 @@ public static class KnownAttributes new TopLevelTypeName("System.Runtime.CompilerServices", nameof(IndexerNameAttribute)), // Parameter attributes: new TopLevelTypeName("System", nameof(ParamArrayAttribute)), + new TopLevelTypeName("System.Runtime.CompilerServices", "ParamCollectionAttribute"), new TopLevelTypeName("System.Runtime.InteropServices", nameof(InAttribute)), new TopLevelTypeName("System.Runtime.InteropServices", nameof(OutAttribute)), new TopLevelTypeName("System.Runtime.InteropServices", nameof(OptionalAttribute)), diff --git a/ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataParameter.cs b/ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataParameter.cs index 14bee08dc5..d117a48cae 100644 --- a/ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataParameter.cs +++ b/ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataParameter.cs @@ -125,6 +125,12 @@ public LifetimeAnnotation Lifetime { var metadata = module.metadata; var parameterDef = metadata.GetParameter(handle); + if ((module.TypeSystemOptions & TypeSystemOptions.ParamsCollections) != 0 + && parameterDef.GetCustomAttributes().HasKnownAttribute(metadata, KnownAttribute.ParamCollection)) + { + // params collections are implicitly scoped + return default; + } if (parameterDef.GetCustomAttributes().HasKnownAttribute(metadata, KnownAttribute.ScopedRef)) { return new LifetimeAnnotation { ScopedRef = true }; @@ -135,11 +141,17 @@ public LifetimeAnnotation Lifetime { public bool IsParams { get { - if (Type.Kind != TypeKind.Array) - return false; var metadata = module.metadata; var parameterDef = metadata.GetParameter(handle); - return parameterDef.GetCustomAttributes().HasKnownAttribute(metadata, KnownAttribute.ParamArray); + if (Type.Kind == TypeKind.Array) + { + return parameterDef.GetCustomAttributes().HasKnownAttribute(metadata, KnownAttribute.ParamArray); + } + if (module.TypeSystemOptions.HasFlag(TypeSystemOptions.ParamsCollections)) + { + return parameterDef.GetCustomAttributes().HasKnownAttribute(metadata, KnownAttribute.ParamCollection); + } + return false; } } diff --git a/ILSpy/Languages/CSharpLanguage.cs b/ILSpy/Languages/CSharpLanguage.cs index 73336640ed..6d66c47360 100644 --- a/ILSpy/Languages/CSharpLanguage.cs +++ b/ILSpy/Languages/CSharpLanguage.cs @@ -116,6 +116,7 @@ public override IReadOnlyList LanguageVersions { new LanguageVersion(Decompiler.CSharp.LanguageVersion.CSharp10_0.ToString(), "C# 10.0 / VS 2022"), new LanguageVersion(Decompiler.CSharp.LanguageVersion.CSharp11_0.ToString(), "C# 11.0 / VS 2022.4"), new LanguageVersion(Decompiler.CSharp.LanguageVersion.CSharp12_0.ToString(), "C# 12.0 / VS 2022.8"), + new LanguageVersion(Decompiler.CSharp.LanguageVersion.CSharp13_0.ToString(), "C# 13.0 / VS 2022.12"), }; } return versions; diff --git a/ILSpy/Properties/Resources.Designer.cs b/ILSpy/Properties/Resources.Designer.cs index cb59e0a290..9106c5c7f7 100644 --- a/ILSpy/Properties/Resources.Designer.cs +++ b/ILSpy/Properties/Resources.Designer.cs @@ -909,6 +909,15 @@ public static string DecompilerSettings_DecompileForEachWithGetEnumeratorExtensi } } + /// + /// Looks up a localized string similar to Decompile params collections. + /// + public static string DecompilerSettings_DecompileParamsCollections { + get { + return ResourceManager.GetString("DecompilerSettings.DecompileParamsCollections", resourceCulture); + } + } + /// /// Looks up a localized string similar to Decompile use of the 'dynamic' type. /// @@ -1127,16 +1136,6 @@ public static string DecompilerSettings_IsUnmanagedAttributeOnTypeParametersShou } } - /// - /// Looks up a localized resource of type System.Object. - /// - public static object DecompilerSettings_LifetimeAnnotations { - get { - object obj = ResourceManager.GetObject("DecompilerSettings.LifetimeAnnotations", resourceCulture); - return ((object)(obj)); - } - } - /// /// Looks up a localized string similar to Use nint/nuint types. /// diff --git a/ILSpy/Properties/Resources.resx b/ILSpy/Properties/Resources.resx index 64871a33b5..bdd6097098 100644 --- a/ILSpy/Properties/Resources.resx +++ b/ILSpy/Properties/Resources.resx @@ -324,6 +324,9 @@ Are you sure you want to continue? Decompile foreach statements with GetEnumerator extension methods + + Decompile params collections + Decompile use of the 'dynamic' type diff --git a/ILSpy/Properties/Resources.zh-Hans.resx b/ILSpy/Properties/Resources.zh-Hans.resx index cae67ec783..f8f9f0d128 100644 --- a/ILSpy/Properties/Resources.zh-Hans.resx +++ b/ILSpy/Properties/Resources.zh-Hans.resx @@ -312,6 +312,9 @@ 反编译使用 GetEnumerator 扩展方法的 foreach 语句 + + + 反编译 dynamic 类型 From 115f70789627e0679f1e211f5fd4102b09fafce7 Mon Sep 17 00:00:00 2001 From: ds5678 <49847914+ds5678@users.noreply.github.com> Date: Sat, 5 Apr 2025 12:32:23 -0700 Subject: [PATCH 2/4] Try using .NET 9 sdk in the workflows --- .github/workflows/build-frontends.yml | 2 +- .github/workflows/build-ilspy.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-frontends.yml b/.github/workflows/build-frontends.yml index 894202f2c3..f49007ef9a 100644 --- a/.github/workflows/build-frontends.yml +++ b/.github/workflows/build-frontends.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/setup-dotnet@v4 with: - dotnet-version: '8.0.x' + dotnet-version: '9.0.x' dotnet-quality: 'ga' - name: Install dependencies diff --git a/.github/workflows/build-ilspy.yml b/.github/workflows/build-ilspy.yml index cf86850ae3..382f1686ff 100644 --- a/.github/workflows/build-ilspy.yml +++ b/.github/workflows/build-ilspy.yml @@ -34,7 +34,7 @@ jobs: - uses: actions/setup-dotnet@v4 with: - dotnet-version: '8.0.x' + dotnet-version: '9.0.x' dotnet-quality: 'ga' env: DOTNET_INSTALL_DIR: ${{ runner.temp }}/.dotnet diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 1508ed57fd..d82444df02 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -37,7 +37,7 @@ jobs: - uses: actions/setup-dotnet@v4 with: - dotnet-version: '8.0.x' + dotnet-version: '9.0.x' dotnet-quality: 'ga' - name: Build From 83a090a7fc47033da736a88d58df09fee315e2c2 Mon Sep 17 00:00:00 2001 From: ds5678 <49847914+ds5678@users.noreply.github.com> Date: Sat, 5 Apr 2025 22:24:56 -0700 Subject: [PATCH 3/4] Revert .NET bump for build-ilspy.yml --- .github/workflows/build-ilspy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ilspy.yml b/.github/workflows/build-ilspy.yml index 382f1686ff..cf86850ae3 100644 --- a/.github/workflows/build-ilspy.yml +++ b/.github/workflows/build-ilspy.yml @@ -34,7 +34,7 @@ jobs: - uses: actions/setup-dotnet@v4 with: - dotnet-version: '9.0.x' + dotnet-version: '8.0.x' dotnet-quality: 'ga' env: DOTNET_INSTALL_DIR: ${{ runner.temp }}/.dotnet From 6e5c2f965ccf62c9e3d6d86c13bc4e67315a7e86 Mon Sep 17 00:00:00 2001 From: ds5678 <49847914+ds5678@users.noreply.github.com> Date: Fri, 18 Apr 2025 22:13:44 -0700 Subject: [PATCH 4/4] Bump TestRunner to .NET 9 --- .../ICSharpCode.Decompiler.TestRunner.csproj | 2 +- ICSharpCode.Decompiler.Tests/Helpers/Tester.cs | 17 ++++++++--------- README.md | 10 +++++----- global.json | 2 +- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/ICSharpCode.Decompiler.TestRunner/ICSharpCode.Decompiler.TestRunner.csproj b/ICSharpCode.Decompiler.TestRunner/ICSharpCode.Decompiler.TestRunner.csproj index af31fefa23..7be97c9061 100644 --- a/ICSharpCode.Decompiler.TestRunner/ICSharpCode.Decompiler.TestRunner.csproj +++ b/ICSharpCode.Decompiler.TestRunner/ICSharpCode.Decompiler.TestRunner.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 enable diff --git a/ICSharpCode.Decompiler.Tests/Helpers/Tester.cs b/ICSharpCode.Decompiler.Tests/Helpers/Tester.cs index 7d7e33f8f6..f4e2826d9a 100644 --- a/ICSharpCode.Decompiler.Tests/Helpers/Tester.cs +++ b/ICSharpCode.Decompiler.Tests/Helpers/Tester.cs @@ -104,9 +104,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/net8.0"); + testRunnerBasePath = Path.Combine(TesterPath, "../../../../../ICSharpCode.Decompiler.TestRunner/bin/Debug/net9.0"); #else - testRunnerBasePath = Path.Combine(TesterPath, "../../../../../ICSharpCode.Decompiler.TestRunner/bin/Release/net8.0"); + testRunnerBasePath = Path.Combine(TesterPath, "../../../../../ICSharpCode.Decompiler.TestRunner/bin/Release/net9.0"); #endif // To parse: packagesPropsFile = Path.Combine(TesterPath, "../../../../../Directory.Packages.props"); @@ -276,8 +276,8 @@ private static string ReplacePrivImplDetails(string il) } static readonly string coreRefAsmPath = new DotNetCorePathFinder(TargetFrameworkIdentifier.NET, - new Version(8, 0), "Microsoft.NETCore.App") - .GetReferenceAssemblyPath(".NETCoreApp,Version=v8.0"); + new Version(9, 0), "Microsoft.NETCore.App") + .GetReferenceAssemblyPath(".NETCoreApp,Version=v9.0"); public static readonly string RefAsmPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), @"Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2"); @@ -313,11 +313,9 @@ private static string ReplacePrivImplDetails(string il) "Microsoft.VisualBasic.dll", }; - const string targetFrameworkAttributeSnippet = @" - -[assembly: System.Runtime.Versioning.TargetFramework("".NETCoreApp,Version=v8.0"", FrameworkDisplayName = """")] - -"; + const string targetFrameworkAttributeSnippet = """ + [assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v9.0", FrameworkDisplayName = "")] + """; static readonly Lazy targetFrameworkAttributeSnippetFile = new Lazy(GetTargetFrameworkAttributeSnippetFile); @@ -391,6 +389,7 @@ public static List GetPreprocessorSymbols(CompilerOptions flags) preprocessorSymbols.Add("NET60"); preprocessorSymbols.Add("NET70"); preprocessorSymbols.Add("NET80"); + preprocessorSymbols.Add("NET90"); } preprocessorSymbols.Add("ROSLYN"); preprocessorSymbols.Add("CS60"); diff --git a/README.md b/README.md index 2a68789b79..92c8d340bb 100644 --- a/README.md +++ b/README.md @@ -48,11 +48,11 @@ How to build - Make sure Windows PowerShell (at least version) 5.0 or [PowerShell](https://github.com/PowerShell/PowerShell) 7+ is installed. - Clone the ILSpy repository using git. - Execute `git submodule update --init --recursive` to download the ILSpy-Tests submodule (used by some test cases). -- Install Visual Studio (documented version: 17.8). You can install the necessary components in one of 3 ways: +- Install Visual Studio (documented version: 17.12). You can install the necessary components in one of 3 ways: - Follow Microsoft's instructions for [importing a configuration](https://docs.microsoft.com/en-us/visualstudio/install/import-export-installation-configurations?view=vs-2022#import-a-configuration), and import the .vsconfig file located at the root of the solution. - Alternatively, you can open the ILSpy solution (ILSpy.sln) and Visual Studio will [prompt you to install the missing components](https://docs.microsoft.com/en-us/visualstudio/install/import-export-installation-configurations?view=vs-2022#automatically-install-missing-components). - Finally, you can manually install the necessary components via the Visual Studio Installer. The workloads/components are as follows: - - Workload ".NET Desktop Development". This workload includes the .NET Framework 4.8 SDK and the .NET Framework 4.7.2 targeting pack, as well as the [.NET 8.0 SDK](https://dotnet.microsoft.com/download/dotnet/8.0) (ILSpy.csproj targets .NET 8.0, but we have net472 projects too). _Note: The optional components of this workload are not required for ILSpy_ + - Workload ".NET Desktop Development". This workload includes the .NET Framework 4.8 SDK and the .NET Framework 4.7.2 targeting pack, as well as the [.NET 9.0 SDK](https://dotnet.microsoft.com/download/dotnet/9.0) (ILSpy.csproj targets .NET 8.0, but we have net472 projects too). _Note: The optional components of this workload are not required for ILSpy_ - Workload "Visual Studio extension development" (ILSpy.sln contains a VS extension project) _Note: The optional components of this workload are not required for ILSpy_ - Individual Component "MSVC v143 - VS 2022 C++ x64/x86 build tools" (or similar) - _The VC++ toolset is optional_; if present it is used for `editbin.exe` to modify the stack size used by ILSpy.exe from 1MB to 16MB, because the decompiler makes heavy use of recursion, where small stack sizes lead to problems in very complex methods. @@ -66,12 +66,12 @@ How to build - ILSpy.AddIn.slnf: for the Visual Studio plugin **Note:** Visual Studio includes a version of the .NET SDK that is managed by the Visual Studio installer - once you update, it may get upgraded too. -Please note that ILSpy is only compatible with the .NET 8.0 SDK and Visual Studio will refuse to load some projects in the solution (and unit tests will fail). -If this problem occurs, please manually install the .NET 8.0 SDK from [here](https://dotnet.microsoft.com/download/dotnet/8.0). +Please note that ILSpy is only compatible with the .NET 9.0 SDK and Visual Studio will refuse to load some projects in the solution (and unit tests will fail). +If this problem occurs, please manually install the .NET 9.0 SDK from [here](https://dotnet.microsoft.com/download/dotnet/9.0). #### Unix / Mac: -- Make sure [.NET 8.0 SDK](https://dotnet.microsoft.com/download/dotnet/8.0) is installed. +- Make sure [.NET 9.0 SDK](https://dotnet.microsoft.com/download/dotnet/9.0) is installed. - Make sure [PowerShell](https://github.com/PowerShell/PowerShell) is installed (formerly known as PowerShell Core) - Clone the repository using git. - Execute `git submodule update --init --recursive` to download the ILSpy-Tests submodule (used by some test cases). diff --git a/global.json b/global.json index 6a5d4badd3..a52d00a7e1 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.100", + "version": "9.0.100", "rollForward": "major", "allowPrerelease": true }