Loading dependencies from Microsoft.AspNetCore.App fails
See original GitHub issueDescribe the bug
Loading and executing a minimal web app as a plugin fail to resolve reference to Microsoft.AspNetCore.Hosting.Abstractions
To Reproduce (-- Repro code provided below further down --)
- Create a new web app, i.e.
dotnet new web
and build it. - Load the web app using
PluginLoader.CreateFromAssemblyFile(pathToWebApp).LoadDefaultAssembly()
; - Execute the web app entrypoint:
app.EntryPoint.Invoke(null, new object[] { new string[] { } });
Expected behavior The application load and execute properly.
Additional context Repro provided:
- Clone https://github.com/per-samuelsson/ReproPluginsIssue
- CD
src
- Run
Run2.bat
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
c# - Loading dependencies from the most recent Microsoft. ...
1 and having FrameworkReference to Microsoft.AspNetCore.App. On my machine, I have ASP.NET Core Runtime 3.1.3 installed. Output from dotnet -- ...
Read more >Fixing unexpected Microsoft.AspNetCore package errors after ...
How to fix missing assets from your precious dependencies? · Open your .csproj file in edit mode · Add your dependency. Obviously, this...
Read more >Why am I getting 'Unable to find package Microsoft. ...
I was working just fine yesterday but this morning I opened my project and began getting 'Unable to find package Microsoft.AspNetCore.App.Ref.' ...
Read more >IIS AspNetCore Module V2: Failed to start application '/LM/ ...
I have a .NET Core 3.1 Web API project that I am hosting using IIS. Project Details (see target framework): <Project Sdk="Microsoft.NET.
Read more >Microsoft.AspNetCore.App metapackage for ASP.NET Core
The ASP.NET Core shared framework: Doesn't include third-party dependencies. Includes all supported packages by the ASP.NET Core team.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sorry for delayed responses. Been swamped at work. I’ll investigate more and see if there is a good solution here. I should have more time now that it is holiday season.
I had a conversation with the .NET Core team. At the moment, there is no plan to support dynamically loading shared frameworks. There isn’t anything my library can do to workaround this, so I’m going to close this as ‘wontfix’. If .NET changes in the future and adds this capability, we can revisit.
The workaround is to have the host application have a reference to Microsoft.AspNetCore.App, even if the host app isn’t using aspnetcore directly. Plugins can’t use AspNetCore unless the app loading the plugin does, too.