Skip to content

Commit 7474efc

Browse files
authored
Correct build transitive targets location (#4773)
Resolves #4772
1 parent edd501a commit 7474efc

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

src/Libraries/Microsoft.Extensions.Telemetry.Abstractions/Microsoft.Extensions.Telemetry.Abstractions.csproj

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,25 @@
2323
<ProjectReference Include="..\Microsoft.Extensions.Compliance.Abstractions\Microsoft.Extensions.Compliance.Abstractions.csproj" />
2424
</ItemGroup>
2525

26+
<!--
27+
The .NET pre-defined props/targets that disable the Microsoft.Extensions.Logging.Abstractions source generator.
28+
This is needed because there are several ways Microsoft.Extensions.Logging.Abstractions source generator can be
29+
referenced in a .NET application (whether it's a console app or an ASP.NET Core app).
30+
31+
For net462 we auto-generate the targets, see below and refer to eng/MSBuild/Packaging.targets for more details.
32+
-->
2633
<ItemGroup>
2734
<None Include="buildTransitive\**\*" CopyToOutputDirectory="PreserveNewest" Pack="true" PackagePath="buildTransitive\%(RecursiveDir)%(Filename)%(Extension)" />
2835
</ItemGroup>
2936

30-
<!-- For net462 we automatically add package buildtransitive target files, so we need to Include
31-
the code that will disable the Microsoft.Extensions.Logging.Abstractions source generator. -->
37+
<!--
38+
For net462 we automatically add package buildtransitive target files, so we need to include
39+
the code that will disable the Microsoft.Extensions.Logging.Abstractions source generator.
40+
There's only one way how the generator can get referenced in net462, so there's no need for
41+
additional logic that's requires for .NET scenarios.
42+
43+
For .NET we have pre-defined props/targets, see above.
44+
-->
3245
<PropertyGroup>
3346
<_AdditionalNETStandardCompatErrorFileContents>
3447
<![CDATA[
@@ -55,4 +68,8 @@
5568
<ItemGroup>
5669
<InternalsVisibleToTest Include="$(AssemblyName).Tests" />
5770
</ItemGroup>
71+
72+
<Target Name="_VerifyBuildTransitiveFolderName" BeforeTargets="Compile">
73+
<Error Text="'buildTransitive\$(MinimumSupportedTfmForPackaging)' does not exist" Condition="!Exists('$(MSBuildThisFileDirectory)\buildTransitive\$(MinimumSupportedTfmForPackaging)\$(AssemblyName).props')" />
74+
</Target>
5875
</Project>
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)