Skip to content

Commit ab504f0

Browse files
committed
Add props/targets disabling Microsoft.Extensions.Logging.Generators for .NET 8
Resolves #4772
1 parent 13a6288 commit ab504f0

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<!-- This package should replace the Microsoft.Extensions.Logging.Abstractions source generator, so we set the property to remove the source generator from the project. -->
3+
<PropertyGroup>
4+
<DisableMicrosoftExtensionsLoggingSourceGenerator>true</DisableMicrosoftExtensionsLoggingSourceGenerator>
5+
</PropertyGroup>
6+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Project>
2+
<!-- This package should replace the Microsoft.Extensions.Logging.Abstractions source generator. -->
3+
<Target Name="_Microsoft_Extensions_Logging_AbstractionsRemoveAnalyzers"
4+
Condition="'$(DisableMicrosoftExtensionsLoggingSourceGenerator)' == 'true'"
5+
AfterTargets="ResolveReferences">
6+
<ItemGroup>
7+
<_Microsoft_Extensions_Logging_AbstractionsAnalyzer Include="@(Analyzer)" Condition="'%(Analyzer.AssemblyName)' == 'Microsoft.Extensions.Logging.Generators' Or
8+
'%(Analyzer.NuGetPackageId)' == 'Microsoft.Extensions.Logging.Abstractions'" />
9+
</ItemGroup>
10+
11+
<!-- Remove Microsoft.Extensions.Logging.Abstractions Analyzer -->
12+
<ItemGroup>
13+
<Analyzer Remove="@(_Microsoft_Extensions_Logging_AbstractionsAnalyzer)" />
14+
</ItemGroup>
15+
</Target>
16+
</Project>

0 commit comments

Comments
 (0)