Loading an external .NET Standard 2.0 assembly with blazor

后端 未结 2 1958
小蘑菇
小蘑菇 2021-02-09 00:24

In a Blazor app, I want to load an external assembly and execute a method. For this, I have created a new ASP.Net Core webapplication using the Blazor template.

Then, in

2条回答
  •  没有蜡笔的小新
    2021-02-09 00:34

    This is caused by the blazor linker stripping out the dependency to netstandard since it's not explicitly used in the main WebAssemblyHost project.

    When dynamically loading a DLL that uses netstandard, it will assume that it was already loaded and crash.

    If you plan to load assemblies dynamically, I recommend using

    false
    

    to ensure non of the base dependencies is stripped out.

提交回复
热议问题