Fixup reference to M.AspNetCore.Components.WebAssembly.HttpHandler (#20891)

* Fixup reference to Microsoft.AspNetCore.Components.WebAssembly.HttpHandler

As part of attempting to fix the reference in the test project (which ultimately wasn't needed), I messed up the package reference in the WebAssembly package
This fixes the package reference and removes unnecessary code from the test project
This commit is contained in:
Pranav K 2020-04-17 14:23:20 -07:00 committed by GitHub
parent ad5b64f268
commit d2ee131fd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 29 additions and 19 deletions

View File

@ -40,4 +40,26 @@
<Import Project="WebAssembly\Build\src\ReferenceFromSource.props" Condition="'$(ReferenceBlazorBuildLocally)' == 'true'" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.targets))\Directory.Build.targets" />
<ItemGroup Condition="'$(FixupWebAssemblyHttpHandlerReference)' == 'true'">
<ProjectReference
Include="$(RepoRoot)src\Components\WebAssembly\WebAssemblyHttpHandler\src\Microsoft.AspNetCore.Components.WebAssembly.HttpHandler.csproj"
CopyLocal="false" />
</ItemGroup>
<Target Name="_FixupReferenceToWebAssemblyHttpHandler"
Condition="'$(FixupWebAssemblyHttpHandlerReference)' == 'true'"
AfterTargets="_ResolveBlazorInputs"
BeforeTargets="_ResolveBlazorOutputs">
<!--
ProjectReference doesn't really play well with IncludeAssets behavior you get when referencing
the package with IncludeAssets="compile".
-->
<ItemGroup>
<_HttpHandlerAssembly Include="@(_BlazorUserRuntimeAssembly)"
Condition="%(_BlazorUserRuntimeAssembly.ProjectReferenceOriginalItemSpec) == '$(RepoRoot)src\Components\WebAssembly\WebAssemblyHttpHandler\src\Microsoft.AspNetCore.Components.WebAssembly.HttpHandler.csproj'" />
<_BlazorUserRuntimeAssembly Remove="@(_HttpHandlerAssembly)" />
</ItemGroup>
</Target>
</Project>

View File

@ -15,9 +15,7 @@
<Reference Include="Microsoft.JSInterop.WebAssembly" />
<ProjectReference
Include="..\..\WebAssemblyHttpHandler\src\Microsoft.AspNetCore.Components.WebAssembly.HttpHandler.csproj"
IncludeAssets="commit"
ReferenceOutputAssembly="false"
Private="true" />
IncludeAssets="compile" />
</ItemGroup>
<ItemGroup>

View File

@ -7,6 +7,7 @@
<RazorLangVersion>3.0</RazorLangVersion>
<!-- Disable compression in this project so that we can validate that it can be disabled -->
<BlazorEnableCompression>false</BlazorEnableCompression>
<FixupWebAssemblyHttpHandlerReference>true</FixupWebAssemblyHttpHandlerReference>
</PropertyGroup>
<ItemGroup>

View File

@ -4,6 +4,7 @@
<TargetFramework>netstandard2.1</TargetFramework>
<ReferenceBlazorBuildLocally>true</ReferenceBlazorBuildLocally>
<RazorLangVersion>3.0</RazorLangVersion>
<FixupWebAssemblyHttpHandlerReference>true</FixupWebAssemblyHttpHandlerReference>
</PropertyGroup>
<ItemGroup>

View File

@ -4,6 +4,7 @@
<TargetFramework>netstandard2.1</TargetFramework>
<RazorLangVersion>3.0</RazorLangVersion>
<ReferenceBlazorBuildLocally>true</ReferenceBlazorBuildLocally>
<FixupWebAssemblyHttpHandlerReference>true</FixupWebAssemblyHttpHandlerReference>
</PropertyGroup>
<ItemGroup>
@ -11,6 +12,7 @@
<Reference Include="Microsoft.AspNetCore.Components.WebAssembly" />
<Reference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" />
<Reference Include="Microsoft.Extensions.Http" />
</ItemGroup>
<ItemGroup>

View File

@ -10,6 +10,8 @@
<!-- Resx generation on Resources.resx only -->
<GenerateResxSource>false</GenerateResxSource>
<FixupWebAssemblyHttpHandlerReference>true</FixupWebAssemblyHttpHandlerReference>
</PropertyGroup>
<ItemGroup>
@ -19,9 +21,6 @@
<Reference Include="Microsoft.AspNetCore.Components.Authorization" />
<Reference Include="Microsoft.AspNetCore.Components.DataAnnotations.Validation" />
<Reference Include="Microsoft.Extensions.Logging.Configuration" />
<ProjectReference
Include="..\..\..\WebAssembly\WebAssemblyHttpHandler\src\Microsoft.AspNetCore.Components.WebAssembly.HttpHandler.csproj"
CopyLocal="false" />
</ItemGroup>
<ItemGroup>
@ -32,17 +31,4 @@
<EmbeddedResource Update="Resources.resx" GenerateSource="true" />
</ItemGroup>
<Target Name="_FixupRefAssembly" AfterTargets="_ResolveBlazorInputs" BeforeTargets="_ResolveBlazorOutputs">
<!--
ProjectReference doesn't really play well with IncludeAssets behavior you get when referencing
the package with IncludeAssets="compile".
-->
<ItemGroup>
<_HttpHandlerAssembly Include="@(_BlazorUserRuntimeAssembly)"
Condition="%(_BlazorUserRuntimeAssembly.ProjectReferenceOriginalItemSpec) == '..\..\..\WebAssembly\WebAssemblyHttpHandler\src\Microsoft.AspNetCore.Components.WebAssembly.HttpHandler.csproj'" />
<_BlazorUserRuntimeAssembly Remove="@(_HttpHandlerAssembly)" />
</ItemGroup>
</Target>
</Project>