This commit is contained in:
Pranav K 2020-04-13 16:07:41 -07:00
parent b289633533
commit f3a1fb6ad3
3 changed files with 15 additions and 23 deletions

View File

@ -109,7 +109,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Compon
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Components.WebAssembly.Server.Tests", "WebAssembly\Server\test\Microsoft.AspNetCore.Components.WebAssembly.Server.Tests.csproj", "{72D3D00C-5281-455F-9E19-646EE766009A}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Components.WebAssembly.Server.Tests", "WebAssembly\Server\test\Microsoft.AspNetCore.Components.WebAssembly.Server.Tests.csproj", "{72D3D00C-5281-455F-9E19-646EE766009A}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Components.WebAssembly.HttpHandler", "WebAssembly\WebAssemblyHttpHandler\src\Microsoft.AspNetCore.Comopnents.WebAssembly.HttpHandler.csproj", "{52744BCB-1046-48C0-93A4-19A311A907B2}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Components.WebAssembly.HttpHandler", "WebAssembly\WebAssemblyHttpHandler\src\Microsoft.AspNetCore.Components.WebAssembly.HttpHandler.csproj", "{52744BCB-1046-48C0-93A4-19A311A907B2}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@ -15,31 +15,26 @@
Condition="'$(BlazorPrunePublishOutput)' != 'false'"> Condition="'$(BlazorPrunePublishOutput)' != 'false'">
<ItemGroup> <ItemGroup>
<!-- Delete stray DLLs from the application. --> <!-- Delete stray contents from the root of the the app. -->
<ResolvedFileToPublish <ResolvedFileToPublish
Remove="%(ResolvedFileToPublish.Identity)" Remove="%(ResolvedFileToPublish.Identity)"
Condition="$([System.String]::Copy('%(ResolvedFileToPublish.RelativePath)').EndsWith('dll'))"/> Condition="'%(ResolvedFileToPublish.RelativePath)' != 'web.config' AND !$([System.String]::Copy('%(ResolvedFileToPublish.RelativePath)').Replace('\','/').StartsWith('wwwroot/'))"/>
<!--Remove stray debugging files.-->
<ResolvedFileToPublish
Remove="%(ResolvedFileToPublish.Identity)"
Condition="$([System.String]::Copy('%(ResolvedFileToPublish.RelativePath)').EndsWith('pdb'))"/>
<!--Remove excluded static assets.-->
<ResolvedFileToPublish
Remove="%(ResolvedFileToPublish.Identity)"
Condition="$([System.String]::Copy('%(ResolvedFileToPublish.RelativePath)').Replace('\','/').StartsWith('Excluded-Static-Web-Assets/'))"/>
</ItemGroup> </ItemGroup>
</Target> </Target>
<!--After moving the resolved files to the publish directory, we can determine
whether or not to copy the standalone config if the user has not provided
their own.-->
<Target <Target
Name="_BlazorCopyStandaloneWebConfig" Name="_BlazorCopyStandaloneWebConfig"
AfterTargets="CopyFilesToPublishDirectory" AfterTargets="_BlazorCleanupPublishOutput;ComputeResolvedFilesToPublishList"
Condition="!Exists('$(PublishDir)web.config')"> Condition="'@(ResolvedFileToPublish->AnyHaveMetadataValue('RelativePath', 'web.config'))' != 'true'">
<WriteLinesToFile
File="$(PublishDir)web.config" <ItemGroup>
Lines="$([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)Standalone.Web.config'))" /> <ResolvedFileToPublish Include="$(MSBuildThisFileDirectory)Standalone.Web.config">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
<RelativePath>web.config</RelativePath>
</ResolvedFileToPublish>
</ItemGroup>
</Target> </Target>
</Project> </Project>

View File

@ -117,8 +117,6 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.Build
var publishDirectory = project.PublishOutputDirectory; var publishDirectory = project.PublishOutputDirectory;
var blazorPublishDirectory = Path.Combine(publishDirectory, "wwwroot");
// Verify web.config // Verify web.config
Assert.FileExists(result, publishDirectory, "web.config"); Assert.FileExists(result, publishDirectory, "web.config");
Assert.FileContains(result, Path.Combine(publishDirectory, "web.config"), webConfigContents); Assert.FileContains(result, Path.Combine(publishDirectory, "web.config"), webConfigContents);
@ -421,7 +419,6 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.Build
File.WriteAllText(path, content); File.WriteAllText(path, content);
} }
private static void VerifyBootManifestHashes(MSBuildResult result, string blazorPublishDirectory) private static void VerifyBootManifestHashes(MSBuildResult result, string blazorPublishDirectory)
{ {
var bootManifestResolvedPath = Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.boot.json"); var bootManifestResolvedPath = Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.boot.json");