question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Loading dependencies from Microsoft.AspNetCore.App fails

See original GitHub issue

Describe 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 --)

  1. Create a new web app, i.e. dotnet new web and build it.
  2. Load the web app using PluginLoader.CreateFromAssemblyFile(pathToWebApp).LoadDefaultAssembly();
  3. 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:

  1. Clone https://github.com/per-samuelsson/ReproPluginsIssue
  2. CD src
  3. Run Run2.bat

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
natemcmastercommented, Nov 24, 2018

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.

1reaction
natemcmastercommented, Jun 21, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found