natemcmaster / DotNetCorePlugins

.NET Core library for dynamically loading code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Question] How to load a plugin the uses different SDK (Microsoft.NET.Sdk.Web) than Host

Simonl9l opened this issue · comments

Hi i'm using version 1.4.0.

I have a Host that running Microsoft.NET.Sdk runtime SDK. I'm looking to launch plugins, some of which provide Web based functionary.

These plugin leverage the Microsoft.NET.Sdk.Web runtime SDK.

Is there a way that I can tell the plugin loader to use the Plugin as the default type resolution host context ?

My current work around is the have the host use the Microsoft.NET.Sdk.Web runtime SDK; but would rather not!

Any recommendations?

I assume need to somehow override the default context?

Try adding this to the host app .csproj file and use the normal SDK.

 <ItemGroup>
    <FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

@natemcmaster - thanks but assume it ends up at the same place as that is what (more or less) .Web does (behind messaging with working directories too), and not otherwise using the dependancies from the plugin as the source, then host...

There is currently no way to support using the Web SDK in the plugin without the host app loading the Microsoft.AspNetCore.App shared framework. The runtime itself doesn’t support dynamically (un)loading shared frameworks.

Thanks