Skip to content

Blazor WebAssembly apps incorrectly load all satellite assemblies #18951

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

Closed
SteveSandersonMS opened this issue Feb 11, 2020 · 0 comments
Closed
Assignees
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly

Comments

@SteveSandersonMS
Copy link
Member

Recently we did some work to fix problems caused by satellite assemblies when building Blazor WebAssembly apps: #18207. The original issues were #17644 and #17754.

Although that change does now make the build succeed, the runtime behavior is not desirable. Applications now download all satellite assemblies for all cultures, even though we don't have any feature to make use of any of them. The JS-side code doesn't have any knowledge of which assemblies are satellite ones or not, or what cultures they relate to, so it has to fetch and load them all.

The simplest fix might be to change the JS-side code to infer cultures based on URLs. For example, the assembly MyAssembly1.dll is culture-independent, whereas en-GB/MyAssembly1.resources.dll could be inferred to be en-GB-specific. A more elaborate solution would be to change the schema of blazor.boot.json so it explicitly has sections for resources of different cultures.

Extra clean-up

As part of doing this, we should review whether the logic for attaching satellite assemblies to the build output is really correct. Currently, Blazor.MonoRuntime.targets contains a task _ResolveBlazorOutputs that claims to do this, but the explanation of its method given in comments is very unclear to me.

  • It's unclear in what way @(ReferenceCopyLocalPaths), @(_BlazorManagedRuntimeAssemby), and @(_BlazorResolvedAssembly) each differ or overlap. Some of them include pdbs, and some don't, with no indication given in the name. And in what sense are "managed runtime assemblies" not the same as the "resolved assemblies"? At the very least, we should have much more specific names for these groups.
  • Better still would be eliminating the use of both @(ReferenceCopyLocalPaths) and @(_BlazorManagedRuntimeAssemby) so we only use @(_BlazorResolvedAssembly) (which has a clear role), and then obtain the extra satellite assemblies from some other source which is actually specific about the fact that its contents really are satellite assemblies, and nothing else.
@SteveSandersonMS SteveSandersonMS added area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly labels Feb 11, 2020
@mkArtakMSFT mkArtakMSFT added the bug This issue describes a behavior which is not expected - a bug. label Feb 12, 2020
@mkArtakMSFT mkArtakMSFT added this to the blazor-wasm-3.2-preview3 milestone Feb 12, 2020
@ghost ghost locked as resolved and limited conversation to collaborators May 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly
Projects
None yet
Development

No branches or pull requests

3 participants