diff --git a/CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj b/CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj index ab2e041..5db76b0 100644 --- a/CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj +++ b/CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj @@ -13,11 +13,12 @@ + - - + + diff --git a/CliFx.Analyzers.Tests/Utils/AnalyzerAssertions.cs b/CliFx.Analyzers.Tests/Utils/AnalyzerAssertions.cs index 7c34d6e..c9e3375 100644 --- a/CliFx.Analyzers.Tests/Utils/AnalyzerAssertions.cs +++ b/CliFx.Analyzers.Tests/Utils/AnalyzerAssertions.cs @@ -2,8 +2,8 @@ using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; -using System.Reflection; using System.Text; +using Basic.Reference.Assemblies; using FluentAssertions.Execution; using FluentAssertions.Primitives; using Microsoft.CodeAnalysis; @@ -58,14 +58,8 @@ namespace CliFx.Analyzers.Tests.Utils var compilation = CSharpCompilation.Create( "CliFxTests_DynamicAssembly_" + Guid.NewGuid(), new[] {ast}, - new[] - { - MetadataReference.CreateFromFile(Assembly.Load("netstandard").Location), - MetadataReference.CreateFromFile(Assembly.Load("System.Runtime").Location), - MetadataReference.CreateFromFile(typeof(object).Assembly.Location), - MetadataReference.CreateFromFile(typeof(Console).Assembly.Location), - MetadataReference.CreateFromFile(typeof(ICommand).Assembly.Location) - }, + ReferenceAssemblies.Net50 + .Append(MetadataReference.CreateFromFile(typeof(ICommand).Assembly.Location)), // DLL to avoid having to define the Main() method new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary) ); diff --git a/CliFx.Tests/CliFx.Tests.csproj b/CliFx.Tests/CliFx.Tests.csproj index b1618d3..1145f89 100644 --- a/CliFx.Tests/CliFx.Tests.csproj +++ b/CliFx.Tests/CliFx.Tests.csproj @@ -13,10 +13,11 @@ + - + diff --git a/CliFx.Tests/Utils/DynamicCommandBuilder.cs b/CliFx.Tests/Utils/DynamicCommandBuilder.cs index c7a78fb..391d64c 100644 --- a/CliFx.Tests/Utils/DynamicCommandBuilder.cs +++ b/CliFx.Tests/Utils/DynamicCommandBuilder.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; +using Basic.Reference.Assemblies; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.Text; @@ -60,16 +61,9 @@ namespace CliFx.Tests.Utils var compilation = CSharpCompilation.Create( "CliFxTests_DynamicAssembly_" + Guid.NewGuid(), new[] {ast}, - new[] - { - MetadataReference.CreateFromFile(Assembly.Load("netstandard").Location), - MetadataReference.CreateFromFile(Assembly.Load("System.Runtime").Location), - MetadataReference.CreateFromFile(typeof(object).Assembly.Location), - MetadataReference.CreateFromFile(typeof(Console).Assembly.Location), - MetadataReference.CreateFromFile(typeof(Enumerable).Assembly.Location), - MetadataReference.CreateFromFile(typeof(DynamicCommandBuilder).Assembly.Location), - MetadataReference.CreateFromFile(typeof(ICommand).Assembly.Location) - }, + ReferenceAssemblies.Net50 + .Append(MetadataReference.CreateFromFile(typeof(ICommand).Assembly.Location)) + .Append(MetadataReference.CreateFromFile(typeof(DynamicCommandBuilder).Assembly.Location)), // DLL to avoid having to define the Main() method new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary) );