Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,18 @@
<Stage>normal</Stage>
<MinCodeCoverage>100</MinCodeCoverage>
<MinMutationScore>100</MinMutationScore>
<!-- Disable automatic generation of TFM-specific buildTransitive files - we use generic ones instead -->
<DisableNETStandardCompatErrors>true</DisableNETStandardCompatErrors>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Microsoft.Extensions.Compliance.Abstractions\Microsoft.Extensions.Compliance.Abstractions.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="buildTransitive\**\*" CopyToOutputDirectory="PreserveNewest" Pack="true" PackagePath="buildTransitive\%(RecursiveDir)%(Filename)%(Extension)" />
<None Include="buildTransitive\*" CopyToOutputDirectory="PreserveNewest" Pack="true" PackagePath="buildTransitive\" />
</ItemGroup>

<!-- For net462 we automatically add package buildtransitive target files, so we need to Include
the code that will disable the Microsoft.Extensions.Logging.Abstractions source generator. -->
<PropertyGroup>
<_AdditionalNETStandardCompatErrorFileContents>
<![CDATA[
<!-- This package should replace the Microsoft.Extensions.Logging.Abstractions source generator, so we set the property to remove the source generator from the project. -->
<PropertyGroup>
<DisableMicrosoftExtensionsLoggingSourceGenerator>true</DisableMicrosoftExtensionsLoggingSourceGenerator>
</PropertyGroup>
]]>
</_AdditionalNETStandardCompatErrorFileContents>
</PropertyGroup>

<ItemGroup>
<AnalyzerReference Include="..\..\Generators\Microsoft.Gen.Logging\Microsoft.Gen.Logging.csproj" />
<AnalyzerReference Include="..\..\Generators\Microsoft.Gen.Metrics\Microsoft.Gen.Metrics.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<!-- This package should replace the "Microsoft.Extensions.Logging.Abstractions" source generator. -->
<Target Name="_Microsoft_Extensions_Logging_AbstractionsRemoveAnalyzers"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact that the two targets had the same name was very intentional, as we want to make sure that the targets are replaced such that only one ever runs in a project evaluation. Do we have a repro project where we can clearly see the issue? I'd like to see that to better understand the problem and validate the RCA made here, as I don't think that target naming colissions was the problem.

<Target Name="_Microsoft_Extensions_Telemetry_AbstractionsRemoveAnalyzers"
Condition="'$(DisableMicrosoftExtensionsLoggingSourceGenerator)' == 'true'"
AfterTargets="ResolveReferences">
<ItemGroup>
Expand All @@ -19,7 +19,7 @@
<!-- We have a WPF-specific target because WPF projects generate and compile a temporary project (via "GenerateTemporaryTargetAssembly" target),
and that temp project doesn't have "ResolveReferences" target we expect.
This leads to the runtime's generator not being removed and to a compile-time error CS0757. This additional target resolves the problem. -->
<Target Name="_Microsoft_Extensions_Logging_AbstractionsRemoveAnalyzersWPF"
<Target Name="_Microsoft_Extensions_Telemetry_AbstractionsRemoveAnalyzersWPF"
Condition="'$(DisableMicrosoftExtensionsLoggingSourceGenerator)' == 'true'"
AfterTargets="RemoveDuplicateAnalyzers">
<ItemGroup>
Expand Down

This file was deleted.

This file was deleted.

Loading