@@ -93,6 +93,10 @@ public enum AssemblerOptions
9393
9494 public static partial class Tester
9595 {
96+ public const string CurrentNetCoreVersion = "11.0" ;
97+ public const string CurrentNetCoreAppVersion = ".NETCoreApp,Version=v11.0" ;
98+ public const string CurrentNetCoreRefAsmVersion = "11.0.0-preview.2.26159.112" ;
99+
96100 public static readonly string TesterPath ;
97101 public static readonly string TestCasePath ;
98102
@@ -108,9 +112,9 @@ static Tester()
108112 TesterPath = Path . GetDirectoryName ( typeof ( Tester ) . Assembly . Location ) ;
109113 TestCasePath = Path . Combine ( TesterPath , "../../../../TestCases" ) ;
110114#if DEBUG
111- testRunnerBasePath = Path . Combine ( TesterPath , "../../../../../ICSharpCode.Decompiler.TestRunner/bin/Debug/net10.0 " ) ;
115+ testRunnerBasePath = Path . Combine ( TesterPath , $ "../../../../../ICSharpCode.Decompiler.TestRunner/bin/Debug/net { CurrentNetCoreVersion } ") ;
112116#else
113- testRunnerBasePath = Path . Combine ( TesterPath , "../../../../../ICSharpCode.Decompiler.TestRunner/bin/Release/net10.0 " ) ;
117+ testRunnerBasePath = Path . Combine ( TesterPath , $ "../../../../../ICSharpCode.Decompiler.TestRunner/bin/Release/net { CurrentNetCoreVersion } ") ;
114118#endif
115119 // To parse: <Project><ItemGroup><PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0-3.final" />
116120 packagesPropsFile = Path . Combine ( TesterPath , "../../../../../Directory.Packages.props" ) ;
@@ -136,6 +140,7 @@ internal static async Task Initialize()
136140 await vswhereToolset . Fetch ( ) . ConfigureAwait ( false ) ;
137141 await RefAssembliesToolset . Fetch ( "5.0.0" , sourcePath : "ref/net5.0" ) . ConfigureAwait ( false ) ;
138142 await RefAssembliesToolset . Fetch ( "10.0.0" , sourcePath : "ref/net10.0" ) . ConfigureAwait ( false ) ;
143+ await RefAssembliesToolset . Fetch ( CurrentNetCoreRefAsmVersion , sourcePath : $ "ref/net{ CurrentNetCoreVersion } ") . ConfigureAwait ( false ) ;
139144
140145#if DEBUG
141146 await BuildTestRunner ( "win-x86" , "Debug" ) . ConfigureAwait ( false ) ;
@@ -341,7 +346,7 @@ private static string ReplacePrivImplDetails(string il)
341346 } ;
342347
343348 static readonly Dictionary < string , Lazy < string > > targetFrameworkAttributeSnippetFiles = new ( ) {
344- { ".NETCoreApp,Version=v10.0" , new Lazy < string > ( ( ) => GetTargetFrameworkAttributeSnippetFile ( ".NETCoreApp,Version=v10.0" ) ) } ,
349+ { CurrentNetCoreAppVersion , new Lazy < string > ( ( ) => GetTargetFrameworkAttributeSnippetFile ( CurrentNetCoreAppVersion ) ) } ,
345350 { ".NETCoreApp,Version=v5.0" , new Lazy < string > ( ( ) => GetTargetFrameworkAttributeSnippetFile ( ".NETCoreApp,Version=v5.0" ) ) } ,
346351 { ".NETCoreApp,Version=v2.2" , new Lazy < string > ( ( ) => GetTargetFrameworkAttributeSnippetFile ( ".NETCoreApp,Version=v2.2" ) ) } ,
347352 } ;
@@ -454,12 +459,15 @@ public static List<string> GetPreprocessorSymbols(CompilerOptions flags)
454459 preprocessorSymbols . Add ( "NET80" ) ;
455460 preprocessorSymbols . Add ( "NET90" ) ;
456461 preprocessorSymbols . Add ( "NET100" ) ;
462+ preprocessorSymbols . Add ( "NET110" ) ;
457463 }
458464 preprocessorSymbols . Add ( "ROSLYN4" ) ;
459465 preprocessorSymbols . Add ( "CS100" ) ;
460466 preprocessorSymbols . Add ( "CS110" ) ;
461467 preprocessorSymbols . Add ( "CS120" ) ;
462468 preprocessorSymbols . Add ( "CS130" ) ;
469+ preprocessorSymbols . Add ( "CS140" ) ;
470+ preprocessorSymbols . Add ( "CS150" ) ;
463471 }
464472 }
465473 else if ( ( flags & CompilerOptions . UseMcsMask ) != 0 )
@@ -520,7 +528,7 @@ public static async Task<CompilerResults> CompileCSharp(string sourceFileName, C
520528 CompilerOptions . UseRoslyn1_3_2 => ( "1.3.2" , "6" , null ) ,
521529 CompilerOptions . UseRoslyn2_10_0 => ( "2.10.0" , "latest" , targetNet40 ? null : ".NETCoreApp,Version=v2.2" ) ,
522530 CompilerOptions . UseRoslyn3_11_0 => ( "3.11.0" , "latest" , targetNet40 ? null : ".NETCoreApp,Version=v5.0" ) ,
523- _ => ( roslynLatestVersion , flags . HasFlag ( CompilerOptions . Preview ) ? "preview" : "latest" , targetNet40 ? null : ".NETCoreApp,Version=v10.0" )
531+ _ => ( roslynLatestVersion , flags . HasFlag ( CompilerOptions . Preview ) ? "preview" : "latest" , targetNet40 ? null : CurrentNetCoreAppVersion )
524532 } ;
525533
526534 var cscPath = roslynToolset . GetCSharpCompiler ( roslynVersion ) ;
@@ -770,7 +778,7 @@ public static void CompileCSharpWithPdb(string assemblyName, Dictionary<string,
770778 }
771779
772780 var compilation = CSharpCompilation . Create ( Path . GetFileNameWithoutExtension ( assemblyName ) ,
773- syntaxTrees , coreDefaultReferences . Select ( r => MetadataReference . CreateFromFile ( Path . Combine ( RefAssembliesToolset . GetPath ( ".NETCoreApp,Version=v10.0" ) , r ) ) ) ,
781+ syntaxTrees , coreDefaultReferences . Select ( r => MetadataReference . CreateFromFile ( Path . Combine ( RefAssembliesToolset . GetPath ( CurrentNetCoreAppVersion ) , r ) ) ) ,
774782 new CSharpCompilationOptions (
775783 OutputKind . DynamicallyLinkedLibrary ,
776784 platform : Platform . AnyCpu ,
0 commit comments