diff --git a/analyzers/tests/SonarAnalyzer.TestFramework/Common/SourceGeneratorProvider.cs b/analyzers/tests/SonarAnalyzer.TestFramework/Common/SourceGeneratorProvider.cs index 1835ea6a441..ebabc7a4985 100644 --- a/analyzers/tests/SonarAnalyzer.TestFramework/Common/SourceGeneratorProvider.cs +++ b/analyzers/tests/SonarAnalyzer.TestFramework/Common/SourceGeneratorProvider.cs @@ -30,12 +30,9 @@ public static class SourceGeneratorProvider public static AnalyzerFileReference[] SourceGenerators { get; } = [ - new(CheckAndReturnRazorSourceGeneratorPath(), new AssemblyLoader()) + new(RazorSourceGeneratorPath, new AssemblyLoader()) ]; - public static string CheckAndReturnRazorSourceGeneratorPath() => - File.Exists(RazorSourceGeneratorPath) ? RazorSourceGeneratorPath : throw new FileNotFoundException($"Razor sourcegenerator not found: {RazorSourceGeneratorPath}"); - public static string LatestSdkFolder() { var objectAssembly = typeof(object).Assembly;