Skip to content
Merged
Changes from 1 commit
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
Next Next commit
chore: Add warnings for UnresolvedAnalyzerReference
  • Loading branch information
filzrev committed Jan 18, 2024
commit 9f68b9ffb5dc7804d89734036befb4b321092766
6 changes: 6 additions & 0 deletions src/Docfx.Dotnet/DotnetApiCatalog.Compile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Microsoft.Build.Framework;
using Microsoft.Build.Logging;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.MSBuild;

#nullable enable
Expand Down Expand Up @@ -132,6 +133,11 @@ await LoadCompilationFromProject(project.AbsolutePath) is { } compilation)
await Process.Start("dotnet", $"restore \"{path}\"").WaitForExitAsync();
}
project = await workspace.OpenProjectAsync(path, msbuildLogger);

foreach (var unresolvedAnalyzer in project.AnalyzerReferences.OfType<UnresolvedAnalyzerReference>())
{
Logger.LogWarning("There is .NET Analyzer that can't be resolved. Path: " + unresolvedAnalyzer.FullPath);
}
}

if (!project.SupportsCompilation)
Expand Down