Problem:
Your WASM application works fine in debug, but when you deploy you start seeing issues where methods and other such things are missing.
Possible Solution: Blazor WASM is similar to Xamarin development in that you want to ensure your app is as small as possible. To that goal, by default the build will strip out any perceived unneeded code from your project. This can have some unforeseen consequences unfortunately. To avoid this consider adding the following properties to your project file:
Disable ALL linking
<PropertyGroup>
<BlazorWebAssemblyEnableLinking>false</BlazorWebAssemblyEnableLinking>
</PropertyGroup>
Disable linking in a more nuanced fasion
<ItemGroup>
<BlazorLinkerDescriptor Include="LinkerConfig.xml" />
</ItemGroup>
If you go with the LinkerConfig.xml please review the reference for guides on how to populate the LinkerConfig.xml
Top comments (0)