Ensure BlazorWebAssembly.js is present (#23518)

This commit is contained in:
Pranav K 2020-06-30 11:38:20 -07:00 committed by GitHub
parent eb76931578
commit 3fe6b07412
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -0,0 +1,5 @@
<Project>
<PropertyGroup>
<BlazorWebAssemblyJSPath>$(MSBuildThisFileDirectory)blazor.webassembly.js</BlazorWebAssemblyJSPath>
</PropertyGroup>
</Project>

View File

@ -92,6 +92,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<!-- <!--
Calculates the outputs and the paths for Blazor WASM. This target is invoked frequently and should perform minimal work. Calculates the outputs and the paths for Blazor WASM. This target is invoked frequently and should perform minimal work.
--> -->
<ItemGroup> <ItemGroup>
<_BlazorJSFile Include="$(BlazorWebAssemblyJSPath)" /> <_BlazorJSFile Include="$(BlazorWebAssemblyJSPath)" />
<_BlazorJSFile Include="$(BlazorWebAssemblyJSMapPath)" Condition="Exists('$(BlazorWebAssemblyJSMapPath)')" /> <_BlazorJSFile Include="$(BlazorWebAssemblyJSMapPath)" Condition="Exists('$(BlazorWebAssemblyJSMapPath)')" />
@ -140,7 +141,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<Output TaskParameter="SatelliteAssembly" ItemName="_BlazorReadSatelliteAssembly" /> <Output TaskParameter="SatelliteAssembly" ItemName="_BlazorReadSatelliteAssembly" />
</BlazorReadSatelliteAssemblyFile> </BlazorReadSatelliteAssemblyFile>
<ItemGroup > <ItemGroup>
<!-- We've imported a previously Cacheed file. Let's turn in to a _BlazorOutputWithTargetPath --> <!-- We've imported a previously Cacheed file. Let's turn in to a _BlazorOutputWithTargetPath -->
<_BlazorOutputWithTargetPath <_BlazorOutputWithTargetPath
Include="@(_BlazorReadSatelliteAssembly)" Include="@(_BlazorReadSatelliteAssembly)"
@ -162,6 +163,12 @@ Copyright (c) .NET Foundation. All rights reserved.
<ReferenceCopyLocalPaths DestinationSubDirectory="$(_BlazorOutputPath)%(ReferenceCopyLocalPaths.DestinationSubDirectory)" /> <ReferenceCopyLocalPaths DestinationSubDirectory="$(_BlazorOutputPath)%(ReferenceCopyLocalPaths.DestinationSubDirectory)" />
</ItemGroup> </ItemGroup>
<!-- A missing blazor.webassembly.js is our packaging error. Produce an error so it's discovered early. -->
<Error
Text="Unable to find BlazorWebAssembly JS files. This usually indicates a packaging error."
Code="RAZORSDK1007"
Condition="'@(_BlazorJSFile->Count())' == '0'" />
<!-- <!--
When building with BuildingProject=false, satellite assemblies do not get resolved (the ones for the current project and the one for When building with BuildingProject=false, satellite assemblies do not get resolved (the ones for the current project and the one for
referenced project). BuildingProject=false is typically set for referenced projects when building inside VisualStudio. referenced project). BuildingProject=false is typically set for referenced projects when building inside VisualStudio.