Skip to content

Commit 3c6dc1c

Browse files
authored
Try different MSBuild things to make build work (#17427)
Fixes #17418
1 parent 6c961ae commit 3c6dc1c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/Components/Blazor/Build/src/ReferenceFromSource.props

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,23 @@
2020
<Reference Include="Microsoft.AspNetCore.Blazor.Mono" />
2121
</ItemGroup>
2222

23+
<Target Name="_BuildBlazorBuildProject" BeforeTargets="ResolveProjectReferences">
24+
<!--
25+
The Blazor.Build project cross-compiles and we need the output of all TFMs to be available in the build output.
26+
We can't represent this in any good way using ProjectReference elements, but we can try and build it instead.
27+
-->
28+
<MSBuild Projects="$(MSBuildThisFileDirectory)Microsoft.AspNetCore.Blazor.Build.csproj" />
29+
</Target>
30+
2331
<!-- This is used as a P2P when building the repo. Normal Blazor projects will get this as a reference through the Blazor.Build package -->
2432
<ItemGroup>
2533
<!-- Ensures these projects are built before the consuming project, but without
2634
adding a runtime dependency on the .dll (to be equivalent to a <PackageDependency>
2735
given that the packed version of this project wouldn't add a .dll reference) -->
2836
<ProjectReference Include="$(MSBuildThisFileDirectory)Microsoft.AspNetCore.Blazor.Build.csproj">
2937
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
30-
<!-- Optimization. Do not require framework compatibility between these projects. -->
3138
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
32-
<UndefineProperties>TargetFramework</UndefineProperties>
39+
<Properties>TargetFramework=$(DefaultNetCoreTargetFramework)</Properties>
3340
</ProjectReference>
3441
<ProjectReference Include="$(MSBuildThisFileDirectory)..\..\DevServer\src\Microsoft.AspNetCore.Blazor.DevServer.csproj">
3542
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>

0 commit comments

Comments
 (0)