-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[release/6.0.1xx][blazorwasm] Fix publishing project with lazy loaded assembly #22145
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A blazorwasm project referencing a razorclasslib project, which is to be lazy loaded, fails to publish with: `error BLAZORSDK1001: Unable to find '[lazy load assembly name].dll' to be lazy loaded later. Confirm that project or package references are included and the reference is used in the project.` - This only happens when the `wasm-tools` workload is installed, irrespective of AOT. - That is because when the workload is installed, `publish+Release` defaults to relinking the runtime - The failure happens during a nested publish. 1. For the nested publish, we essentially run `Publish` target, and then the wasm native targets run 2. during the `Publish` part of it: a. we get to `ProcessPublishFilesForBlazor`, which currently we skip for the nested publish case (`$(WasmBuildingForNestedPublish)`) - and this target populates `@(StaticWebAsset)`, when run b. Then we get to `GeneratePublishBlazorBootJson`, which fails because it doesn't have the `StaticWebAssets` correctly populated, and thus can't find the lazy loaded assembly This commit fixes it by: 1. Making the nested publish run after *ComputeFilesToPublish* instead of a full `Publish`[1] 2. Disable certain targets related to static web assets, and compression, since those are not really needed for the nested publish. .. which essentially means that we run a reduced set of targets as part of the "nested publish", and don't trigger some unncessary ones. In future, this will be cleaned up. Co-authored by: @javiercn Fixes dotnet/runtime#60479 --- 1. this needs a corresponding change in the wasm targets to enable using `ComputeFilesToPublish`, instead of `Publish`.
dotnet-issue-labeler
bot
added
the
Area-AspNetCore
RazorSDK, BlazorWebAssemblySDK, dotnet-watch
label
Oct 18, 2021
lewing
reviewed
Oct 18, 2021
src/BlazorWasmSdk/Targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets
Outdated
Show resolved
Hide resolved
lewing
reviewed
Oct 18, 2021
src/BlazorWasmSdk/Targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets
Outdated
Show resolved
Hide resolved
src/BlazorWasmSdk/Targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets
Outdated
Show resolved
Hide resolved
…6_0.targets Co-authored-by: Larry Ewing <lewing@microsoft.com>
…6_0.targets Co-authored-by: Larry Ewing <lewing@microsoft.com>
pranavkm
approved these changes
Oct 18, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
once @lewing's suggestions are incorporated.
…6_0.targets Co-authored-by: Larry Ewing <lewing@microsoft.com>
lewing
approved these changes
Oct 18, 2021
lewing
changed the title
[blazorwasm] Fix publishing project with lazy loaded assembly
[release/6.0.1xx][blazorwasm] Fix publishing project with lazy loaded assembly
Oct 18, 2021
radical
added a commit
to radical/runtime
that referenced
this pull request
Oct 21, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes a user reported issue - dotnet/runtime#60479
Customer Impact
This fixes publish for blazorwasm projects that use lazy loaded assemblies, when the wasm-tools workload is installed.
Testing
Some manual testing, manually running blazor/sdk tests with the workload, and a new unit test.
Regression
Yes.
Risk
Low.