Skip to content

Commit fddde2a

Browse files
wtgodbeCopilot
andcommitted
Put package build assets in TFM-specific folders
When a package has a build/ or buildMultiTargeting/ folder without a TFM subfolder, NuGet considers it compatible with any TFM. This causes builds that should fail at restore to instead hit confusing runtime errors. Move all build/buildMultiTargeting/buildTransitive assets into TFM subfolders (e.g., build/net11.0/ instead of build/) and fix all relative paths in the targets/props files that break from being one directory deeper: - Identity.UI: forwarding targets use ../../build/$(TargetFramework)/ - WebView: forwarding props use ../../build/$(TargetFramework)/ - Grpc.JsonTranscoding: proto path uses ../../content/protos - ApiDescription.Client: task assembly path uses ../../tasks/ - ApiDescription.Client: buildMultiTargeting uses ../../build/netstandard2.0/ - SpaProxy: no internal paths to fix (just PackagePath change) Fixes #58990 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent c31cb17 commit fddde2a

12 files changed

Lines changed: 24 additions & 21 deletions

File tree

src/Components/WebView/WebView/src/Microsoft.AspNetCore.Components.WebView.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
</ItemGroup>
3434

3535
<ItemGroup>
36-
<None Include="buildTransitive\Microsoft.AspNetCore.Components.WebView.props" Pack="true" PackagePath="%(Identity)" />
37-
<None Include="buildMultiTargeting\Microsoft.AspNetCore.Components.WebView.props" Pack="true" PackagePath="%(Identity)" />
38-
<None Include="build\Microsoft.AspNetCore.Components.WebView.props" Pack="true" PackagePath="%(Identity)" />
36+
<None Include="buildTransitive\Microsoft.AspNetCore.Components.WebView.props" Pack="true" PackagePath="buildTransitive\$(DefaultNetCoreTargetFramework)\" />
37+
<None Include="buildMultiTargeting\Microsoft.AspNetCore.Components.WebView.props" Pack="true" PackagePath="buildMultiTargeting\$(DefaultNetCoreTargetFramework)\" />
38+
<None Include="build\Microsoft.AspNetCore.Components.WebView.props" Pack="true" PackagePath="build\$(DefaultNetCoreTargetFramework)\" />
3939
</ItemGroup>
4040

4141
<ItemGroup>
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
<Project>
2-
<Import Project="..\build\Microsoft.AspNetCore.Components.WebView.props" />
2+
<!-- Packed at buildMultiTargeting/<tfm>/. Navigate to package root then into build/<tfm>/. -->
3+
<Import Project="$(MSBuildThisFileDirectory)..\..\build\$(TargetFramework)\Microsoft.AspNetCore.Components.WebView.props"/>
34
</Project>
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
<Project>
2-
<Import Project="..\build\Microsoft.AspNetCore.Components.WebView.props" />
2+
<!-- Packed at buildTransitive/<tfm>/. Navigate to package root then into build/<tfm>/. -->
3+
<Import Project="$(MSBuildThisFileDirectory)..\..\build\$(TargetFramework)\Microsoft.AspNetCore.Components.WebView.props"/>
34
</Project>

src/Grpc/JsonTranscoding/src/Microsoft.AspNetCore.Grpc.JsonTranscoding/Microsoft.AspNetCore.Grpc.JsonTranscoding.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
<!-- See https://github.com/dotnet/aspnetcore/issues/52006 for more details. -->
4949
<None Include="build\*.targets">
5050
<Pack>true</Pack>
51-
<PackagePath>build;buildTransitive</PackagePath>
51+
<PackagePath>build\$(DefaultNetCoreTargetFramework);buildTransitive\$(DefaultNetCoreTargetFramework)</PackagePath>
5252
</None>
5353
</ItemGroup>
5454
</Project>

src/Grpc/JsonTranscoding/src/Microsoft.AspNetCore.Grpc.JsonTranscoding/build/Microsoft.AspNetCore.Grpc.JsonTranscoding.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<!-- This targets file allows annotations.proto and http.proto, which are bundled in package, to be included in Grpc.Tools compilation. -->
44
<!-- This saves the developer having to find and copy these files to the right location when doing gRPC JSON transcoding. -->
55
<PropertyGroup>
6-
<!-- The path of the proto files. Content from the nupkg. -->
7-
<GrpcJsonTranscoding_ProtosPath>$( [System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)../content/protos) )</GrpcJsonTranscoding_ProtosPath>
6+
<!-- The path of the proto files. Content from the nupkg. Packed at build/<tfm>/, so go up two levels to package root. -->
7+
<GrpcJsonTranscoding_ProtosPath>$( [System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)../../content/protos) )</GrpcJsonTranscoding_ProtosPath>
88
</PropertyGroup>
99

1010
<!-- Run immediately before the Protobuf_BeforeCompile extension point. -->

src/Identity/UI/src/Microsoft.AspNetCore.Identity.UI.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
<ItemGroup>
2929
<None Include="@(Content)" />
3030
<Content Remove="@(Content)" />
31-
<None Include="build\*" Pack="true" PackagePath="build\" />
32-
<None Include="buildMultiTargeting\*" Pack="true" PackagePath="buildMultiTargeting\" />
33-
<None Include="buildTransitive\*" Pack="true" PackagePath="buildTransitive\" />
31+
<None Include="build\*" Pack="true" PackagePath="build\$(DefaultNetCoreTargetFramework)\" />
32+
<None Include="buildMultiTargeting\*" Pack="true" PackagePath="buildMultiTargeting\$(DefaultNetCoreTargetFramework)\" />
33+
<None Include="buildTransitive\*" Pack="true" PackagePath="buildTransitive\$(DefaultNetCoreTargetFramework)\" />
3434
</ItemGroup>
3535

3636
<ItemGroup>
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
<Project>
2-
<Import Project="$(MSBuildThisFileDirectory)..\buildTransitive\Microsoft.AspNetCore.Identity.UI.targets"/>
2+
<!-- Packed at buildMultiTargeting/<tfm>/. Navigate to package root then into buildTransitive/<tfm>/. -->
3+
<Import Project="$(MSBuildThisFileDirectory)..\..\buildTransitive\$(TargetFramework)\Microsoft.AspNetCore.Identity.UI.targets"/>
34
</Project>
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
<Project>
2-
<Import Project="$(MSBuildThisFileDirectory)..\build\Microsoft.AspNetCore.Identity.UI.targets"/>
2+
<!-- Packed at buildTransitive/<tfm>/. Navigate to package root (../..) then into build/<tfm>/. -->
3+
<Import Project="$(MSBuildThisFileDirectory)..\..\build\$(TargetFramework)\Microsoft.AspNetCore.Identity.UI.targets"/>
34
</Project>

src/Middleware/Spa/SpaProxy/src/Microsoft.AspNetCore.SpaProxy.csproj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111

1212
<ItemGroup>
1313
<Reference Include="Microsoft.AspNetCore.Hosting" />
14-
<Reference Include="Microsoft.AspNetCore.Hosting.Abstractions" />
15-
<Reference Include="Microsoft.AspNetCore.Http.Abstractions" />
16-
<Reference Include="Microsoft.AspNetCore.Http.Features" />
17-
<None Update="build\Microsoft.AspNetCore.SpaProxy.targets" Pack="true" PackagePath="build\Microsoft.AspNetCore.SpaProxy.targets" />
14+
<None Update="build\Microsoft.AspNetCore.SpaProxy.targets" Pack="true" PackagePath="build\$(DefaultNetCoreTargetFramework)\Microsoft.AspNetCore.SpaProxy.targets" />
1815
</ItemGroup>
1916

2017
</Project>

src/Tools/Extensions.ApiDescription.Client/src/Microsoft.Extensions.ApiDescription.Client.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
<files>
88
$CommonFileElements$
9-
<file src="build\*" target="build" />
10-
<file src="buildMultiTargeting\*" target="buildMultiTargeting" />
9+
<file src="build\*" target="build\netstandard2.0" />
10+
<file src="buildMultiTargeting\*" target="buildMultiTargeting\netstandard2.0" />
1111
<file src="$baseOutputPath$\$configuration$\netstandard2.0\Microsoft.Extensions.ApiDescription.Client.*" target="tasks\netstandard2.0" />
1212
</files>
1313
</package>

0 commit comments

Comments
 (0)