Skip to content

Fix Blazor WASM SDK bugs #24172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 21, 2020
Merged

Conversation

pranavkm
Copy link
Contributor

No description provided.

@pranavkm pranavkm requested review from SteveSandersonMS and a team as code owners July 21, 2020 20:04
@ghost ghost added the area-blazor Includes: Blazor, Razor Components label Jul 21, 2020
@@ -32,7 +32,7 @@ Copyright (c) .NET Foundation. All rights reserved.

<PropertyGroup>
<!-- Paths to tools, tasks, and extensions are calculated relative to the BlazorWebAssemblySdkDirectoryRoot. This can be modified to test a local build. -->
<BlazorWebAssemblySdkDirectoryRoot Condition="'$(BlazorWebAssemblySdkDirectoryRoot)'==''">$(MSBuildThisFileDirectory)..\..\</BlazorWebAssemblySdkDirectoryRoot>
<BlazorWebAssemblySdkDirectoryRoot Condition="'$(BlazorWebAssemblySdkDirectoryRoot)'==''">$(MSBuildThisFileDirectory)..\</BlazorWebAssemblySdkDirectoryRoot>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our integration tests run from the build output and do not exercise this code path. Our templates will once we have a .NET SDK that includes the Blazor SDK

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our templates will once we have a .NET SDK that includes the Blazor SDK

When will we be doing this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to insert the Blazor SDK -> .NET SDK -> Installer -> update our global.json to use this build -> Golden!

@@ -69,7 +69,7 @@ Copyright (c) .NET Foundation. All rights reserved.

</PropertyGroup>

<Import Project="Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets" />
<Import Project="Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets" Condition="'$(ServiceWorkerAssetsManifest)' != ''" />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our test app always had a service worker. Importing this was causing issues in a project that did not have a service worker. I added build and publish tests for an app that's closer to our standalone template.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious: what issues did it cause for projects that didn't have service workers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The targets unconditionally run when the file is imported: https://github.com/dotnet/aspnetcore/blob/master/src/Components/WebAssembly/Sdk/src/targets/Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets#L16. This results in spooky errors because it assumes a manifest file exists

* Correctly calculate tasks path when running as a SDK
* Do not perform service-worker things when project does not require it
@pranavkm pranavkm force-pushed the prkrishn/fixup-bugs branch from ef27b2b to a011848 Compare July 21, 2020 20:54
@pranavkm pranavkm added this to the 5.0.0-preview8 milestone Jul 21, 2020
@mkArtakMSFT mkArtakMSFT merged commit 0b415b9 into release/5.0-preview8 Jul 21, 2020
@mkArtakMSFT mkArtakMSFT deleted the prkrishn/fixup-bugs branch July 21, 2020 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants