Failed to load aspnetcore.dll

I usually develop the Windows 7 desktop using the visual studio 2015 3 update. I have the same vs2015.3 on my Windows 10 laptop. I copied the asp mvc 5 application. I work on the laptop, but it does not start when I try to start it from VS. I get the error "aspnetcore.dll failed to load". I looked around, and most of the solutions are to restore the asp net core installation, but my laptop does not have an asp net kernel built in, because I am not using the kernel yet. My project targets .Net 4.6.

There is a Core on my desktop. So I have to install the .net kernel just because? Or is there another solution? I use IIS 10 by default.

+6
source share
4 answers

Found a solution - the applicationhost.config file had links to the ASP.NET core and tried to load a non-existent module. I deleted the applicationhost.config file and reopened the solution that forced VS to rebuild it without links to ASP.NET Core. Now it works fine.

In my case with Visual Studio 2015, this file was in the .vs \ config \ applicationhost.config directory

For earlier versions of Visual Studio using IIS Express, see this question for more information on where applicationhost.config is located: Where is the IIS Express configuration / metabase file found?

+11
source

Installing the recently released Anniversary Update (version 1607), Windows 10 seems to destabilize IIS by disabling application pools, which results in a 503 error when trying to start an application that is caused by some DLLs not loading when the workflow begins.

Browse the Windows Event Viewer (Win + X, V) to find out what you need to fix: Open Windows Logs, then Application, and look for Error level entries with the source IIS-W3SVC-WP (may vary if the name of your IIS instance is not standard). In details you will see a short message, for example:

The Module DLL <path-to-DLL> failed to load. The data is the error. 

Depending on your configuration, different DLL calls may occur that cause this problem, and they will occur one after another, so you will need to check the event logs and fix the problems until the application starts correctly. Of course, before each attempt, stop IIS and close IIS Manager.

Here are two specific problems that we have experienced so far and how to fix them, but you may encounter completely different ones:

 1."C:\WINDOWS\system32\inetsrv\rewrite.dll" (reference) β—¦Go to "Programs and Features" (Win+X, F) and repair "IIS URL Rewrite Module 2". 2."C:\WINDOWS\system32\inetsrv\aspnetcore.dll" (reference) β—¦Go to "Programs and Features" (Win+X, F) and repair "Microsoft .NET Core 1.0.0 - VS 2015 Tooling ...". 

Source source

+3
source

Removing applicationhost.config did not help me.

My service was forced to work in 32-bit mode, and my aspnetcore was 64 bits.

Since I am not currently using the .NET kernel, I could comment out all the aspnetcore links in the applicationhost.config file and then restart iis.

+1
source

Using VS 2015 (Windows 10). Working with a downloaded MVC sample application (from Intuit) .NET 4.6.1 .

I was getting the exact dsame behaivior / error: "The DLL module C: \ Program Files (x86) \ IIS Express \ aspnetcore.dll could not load"

Finding Applicationhost.config (part of the download package) and deleting it did not solve the problem because IISExpress re-created Applicationhost.config with the same links.

To solve the problem, I had to comment out all the links ( aspnetcore.dll ):

  • (configSections) <section name = "aspNetCore" overrideModeDefault = "Allow" / ">

  • (globalModules) <add name = "AspNetCoreModule" image = "% IIS_BIN% \ aspnetcore.dll" / ">

  • (modules) <add name = "AspNetCoreModule" lockItem = "true" / ">

You can search and comment accordingly.

0
source

Source: https://habr.com/ru/post/1011525/


All Articles