Skip to content

[Blazor] Custom ICU loading from runtime path #90018

@ilonatommy

Description

@ilonatommy

First merge #89771, then fix this one.

  • Load properly a user-created custom file from a full path - easy to fix.
  • Load a runtime-pack custom file from a full path:
/workspaces/runtime/artifacts/bin/dotnet-latest/sdk/8.0.100-rc.1.23404.1/Sdks/Microsoft.NET.Sdk.StaticWebAssets/targets/Microsoft.NET.Sdk.StaticWebAssets.targets(475,5): 
error : Conflicting assets with the same target path '_framework/icudt.dat'.

Even when we make sure that icudt.dat filename is removed from the @(WasmNativeAsset) item before adding it, it still keeps a duplicated entry with this value. Most probably some Task is adding it after Blazor SDK's _ResolveGlobalizationConfiguration is executed but no idea how.

  • Load a runtime-pack custom file from a relative path:
    In Wasm app we are able to load the files from paths relative to runtime pack because we have access to $(MicrosoftNetCoreAppRuntimePackRidNativeDir) value and we append it as a prefix in case the path passed to custom icu msbuild property is not absolute:
    <_WasmIcuDataFileName Condition="'$(HybridGlobalization)' != 'true' and '$(WasmIcuDataFileName)' != '' and !Exists('$(WasmIcuDataFileName)')">$(MicrosoftNetCoreAppRuntimePackRidNativeDir)$(WasmIcuDataFileName)</_WasmIcuDataFileName>

    In Blazor we don't have access to that directly. We could extract it assuming that e.g. dotnet.js is in the runtime pack location and assuming that its added to @(WasmNativeAsset) but it's not a perfect solution.
    cc @lewing

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions