aspnetcore.dll failed to load #597 #1583

Closed
barrytang opened this Issue Jun 20, 2016 · 89 comments

Projects

None yet
@barrytang

Every time a new build is installed, the system stops loading correctly the dll aspnetcore.

Error message in "Event Viewer":
The Module DLL C:\WINDOWS\system32\inetsrv\aspnetcore.dll failed to load. The data is the error.
Log Name: Application
Source: IIS-W3SVC-WP
Level: Error

Relevant System information:
OS Name: Microsoft Windows 10 Enterprise Insider Preview
OS Version: 10.0.14366 N/A Build 14366
OS Manufacturer: Microsoft Corporation
OS Configuration: Member Workstation
OS Build Type: Multiprocessor Free
Product ID: 00359-80000-00001-AA999
Original Install Date: 6/16/2016, 6:37:31 AM
System Boot Time: 6/16/2016, 6:11:50 AM
System Manufacturer: Hewlett-Packard
System Model: HP Z420 Workstation
System Type: x64-based PC
Processor(s): 1 Processor(s) Installed.
[01]: Intel64 Family 6 Model 45 Stepping 7 GenuineIntel ~3201 Mhz
BIOS Version: Hewlett-Packard J61 v03.06, 3/27/2013
Windows Directory: C:\WINDOWS
System Directory: C:\WINDOWS\system32
Boot Device: \Device\HarddiskVolume1
System Locale: en-us;English (United States)
Input Locale: en-us;English (United States)
Time Zone: (UTC-08:00) Pacific Time (US & Canada)
Total Physical Memory: 16,307 MB
Available Physical Memory: 7,019 MB
Virtual Memory: Max Size: 19,251 MB
Virtual Memory: Available: 6,503 MB
Virtual Memory: In Use: 12,748 MB
Page File Location(s): C:\pagefile.sys
Hotfix(s): N/A
Network Card(s): 1 NIC(s) Installed.
[01]: Intel(R) 82579LM Gigabit Network Connection
Hyper-V Requirements: VM Monitor Mode Extensions: Yes
Virtualization Enabled In Firmware: No
Second Level Address Translation: Yes
Data Execution Prevention Available: Yes

@barrytang

Opened on behalf of @teovc.

@barrytang barrytang referenced this issue in aspnet/Tooling Jun 20, 2016
Closed

aspnetcore.dll failed to load #597

@Tratcher
Member

@teovc there should be more details bellow "The data is the error." in the event log.

@teovc
teovc commented Jun 20, 2016

In the details view of the error message, there's the following [see attached image].
A little search in Bing, indicates that the error is related with 32 bit applications, but the application pool has that option enabled.
capture
capture2

@pan-wang

The error indicates the 32-bit AppPool is trying to load 64-bit aspnetcore.dll. could you please share the file info "C:\Windows\System32\inetsrv\aspnetcore.dll" and "C:\Windows\SysWOW64\inetsrv\aspnetcore.dll"

@teovc
teovc commented Jun 20, 2016

Can you please be a little more specific about the information you want to see? (aka, is that what you're looking for?)
capture
capture2

@pan-wang

The file looks correct. I installed the same version MSI as yours on a Win 10 box and worked. Something wrong with your machine configuration. Could you please share your applicationhost.config and web.config.
As a workaround, you can set the "enable 32-bit application" to false to see whether it helps.

@teovc
teovc commented Jun 20, 2016

The dlls work, the problem happens when a new version of the OS is installed as part of Self-hosting experience.
Right now, I'm using the Default Web Site (C:\inetpub\wwwroot). Attached is the web.config file (with the txt extension since GitHub complains).
web.config.txt

@pan-wang

That web.config is not the one you used for ASP.NET Core application as it does not contain any ASP.NET Core Module setting. Could you please try uninstall ASP.NET Core bundle and then reinstall it after OS upgrade to see whether it helps?

@pan-wang

could you please share applicationhost.config under C:\Windows\System32\inetsrv\config. This file is IIS configuration file and specify the path of aspnetcore.dll.

@teovc
teovc commented Jun 21, 2016

I'm going to try that option. In the meantime, here is the applicationhost.config file. Please, be aware that the solution so far (repair or remove / install) takes some time that people is losing. Individuals outside to the organization might not be too much affected by the issue since the rate of OS updates is less frequently that someone inside the organization. Thanks.
applicationHost.config.txt

@edobnet
edobnet commented Jul 5, 2016

same question to me
because the application must run 32-bit and Intergrate

@proludio
proludio commented Jul 5, 2016

Just wanted to add in that I just ran into this issue.
When you say uninstall "ASP.NET Core bundle", which part are you referring to?

@edobnet
edobnet commented Jul 5, 2016

I want to run old application in 32bit mode
also I wanted to study ASP.NET Core application
bad way to uninstall "ASP.NET Core bundle", has any other way?

@teovc
teovc commented Jul 5, 2016

Hi all,
I removed the two packages related with ASP.NET Core from the Control Panel / Add or Remove programs, then I let VS to install the next version of ASP.NET Core (Microsoft.NET Core 1.0.0 - SDK Preview 2 (x64), and Microsoft.NET Core 1.0.0 - VS 2015 Tooling Preview 2) and the issue is still present when a new version of the OS is installed.

@fletchsod-developer
fletchsod-developer commented Jul 5, 2016 edited

Under VS2015 - Update 2, the solution/projects works fine but when I upgraded to VS2015 - Update 3, along with extensions updates, I ran into this issue. So, something is different that broke the solution/projects. All of the projects are under .NET v4.6 frameworks, there's no .NET core projects/solution here. Few days later, when I cloned the source code from TFS, it then works with no evidence of error. Strange. That doesn't make sense either.

@BryanTheCrow
BryanTheCrow commented Jul 13, 2016 edited

Just want to add I run into this issue every time a new Insider build of Windows 10 comes out. I end up having to uninstall/re-install .Net Core every time. If this isn't fixed before the Anniversary Update launches on Aug 2, there are going to be a lot of confused devs out there.

@andreabalducci

Same issue upgrading from Win 8.1 to Win 10.
Uninstall & re-install of DotNetCore.1.0.0-VS2015Tools.Preview2.exe fixed.

@MattMystic

Only had to run the 'repair' to get it to work again. I didn't have to do the full uninstall/install. But I just updated to the Anniversary Update and was a little upset that I ran into this issue right off the bat.

@Jmrizkallah

Same here after updating to the anniversary update...

@bradfalk
bradfalk commented Aug 8, 2016

Running a Repair on Microsoft .NET Core 1.0.0 - VS 2015 Tooling Preview 2, plus a reboot, also worked for me after installing the anniversary update.

@JoshSchreuder

Running a Repair on Microsoft .NET Core 1.0.0 - VS 2015 Tooling Preview 2, plus a reboot, also worked for me after installing the anniversary update.

Confirmed this worked for me on Build 14393.

Installed Tooling Preview 2 from https://www.microsoft.com/net/core#windows
Didn't have to reboot, just started my app pool and my website was running again.

@frank3nst3in

Running a Repair on Microsoft .NET Core 1.0.0 - VS 2015 Tooling Preview 2, plus a reboot, also worked for me after installing the anniversary update.

Thanks, running a repair and re-starting the application pool solved this issue for me. The issue started after the "Anniversary Update".

@realwarder

Same issue here - broken after Windows 10 Anniversary Update - i.e. new OS update breaks it.

@yzorg
yzorg commented Aug 25, 2016

On my box aspnetcore.dll module was installed as a global module, so when IIS couldn't load the DLL it blocked all app pools from starting (including app pool retries, hitting retry limit, then disabling the app pool ... one at a time ... whenever each app pool tries to start on first request).

This is about as far from the benefits of "isolated xcopy deploy per app" as I can think of: OS update breaks all web apps on the developer's computer.

@gcy2
gcy2 commented Sep 9, 2016 edited

I had the additional problem of not being able to Repair or Uninstall Core Tooling Preview 2 (the "account already exists" error). Doing a Repair on VS 2015 seems to have fixed the aspnetcore.dll failing to load problem.

@mgpx
mgpx commented Sep 13, 2016

Confirmed this worked for me on Build 14393.

Installed Tooling Preview 2 from https://www.microsoft.com/net/core#windows
Didn't have to reboot, just started my app pool and my website was running again.

This worked for me.
I needed to install and repair, the two items because there was not yet installed the .net core, was only with IIS...
Only the installation did not work for me .

@morganpdx

Same problem and resolution here. Just repaired .NET Core 1.0.0 RC2, Tooling Preview 1.

@pbachman

Repaired .NET Core 1.0.1 VS 2015 Tooling Preview 2 on my machine fixed the problem.

@FlapperMK

just had this with this week's windows 10 ver 1607 update too. Had to repair ".NET Core 1.0.0 RC2, Tooling Preview 1"
found this page via stackoverflow http://stackoverflow.com/questions/37475214/net-mvc-4-project-fails-with-event-log-error-the-module-dll-c-windows-system3

@psmorandi

I had the same issue today and, as the same as everyone here, repaired .NET Core 1.0.1 VS 2015 Tooling Preview 2 on my machine fixed the problem. The weird thing though, it's that I had just installed this tooling today, just after I installed some patch of visual studio's update 3.

@MPanahandeh

I have the same issue I ended up uninstalling all .net core stuff in my machine to do my legacy work :(

@korakanchan

Uninstall .NET Core 1.0.0 RC2 SDK Preview1 (x64). then Repair NET Core 1.0.0 RC2, Tooling Preview 1.
works for me

@freeboarder

Had the same issue after updating to Windows 10 Anniversary. Repairing .NET Core 1.0.1 VS 2015 Tooling Preview 2 solved the issue. I also had to reinstall the URL Rewrite Module I have installed, that cause a similar error.

@jhkimnew

@freeboarder Hi, I am trying to find the repro steps of this issue. From which OS you updated your machine to Windows 10 Anniversary, Windows 10 or Window 8.1? And please explain what exactly you did for updating to Windows 10 so that I can do the same to reproduce the issue.

@jhkimnew

@freeboarder, Today, I tried to reproduce the issue but failed to reproduce the issue. Here is what I did. Please let me know if there is anything missing to reproduce the issue you ran into.

  1. Prepare an amd64 machine and install Win10 RTM build 14393.0.160715
  2. Install IIS
  3. Install VS 2015 + VS Update3
  4. Go to https://www.micorosft.com/net/core#windows and then install โ€œ.NET Core 1.0.1 - VS 2015 Tooling Preview 2โ€
  5. Restart the machine to refresh IIS services to apply the Dotnet tool configurations
  6. Create a sample aspnetcore app and deploy to IIS and verify everything is working
  7. Go to Settings > Updates & Security > Windows Update and install the "Update for Windows 10 Version 1607 for x64-based Systems (KB3176936)
  8. After the update, I confirmed everything is still working
@FlapperMK

@jhkimnew this occurred when the windows upgrade to v1607 occurred last week. Have an older release of windows with iis installed. Then install the url rewriting addon and the .net tooling previews. Them let the windows upgrade to v1607. It reconfigures iis and gives the error we've mentioned. Repairing the installs solves the error but the upgrade should cope really. That's how I encountered it anyway.

@jhkimnew

@FlapperMK What do you mean with "reconfigures iis"?
Do you mean the aspnetcore.dll module is gone? Or, the aspnetcore.dll file is gone? Or both?
In normal/successful upgrading OS, IIS should not reset its configuration and any files. I already confirmed it on my test machines.
If you know the repro steps, please share that to me so that we can investigate the issue.

@FlapperMK

The tooling was installed via visual studio. Upon upgrading iis failed to initialise due to the errors given above. Iis still had pointers for the tooling but something wasn't found somewhere producing the error. Repairinh the install fixed the issue and iis initialised successfully. Nothing was browsable until the repair.

@jhkimnew
jhkimnew commented Sep 27, 2016 edited

@FlapperMK In order for me to understand this issue, please tell me if the %SystemRoot%\system32\inetsrv\aspnetcore.dll file exists or not when IIS fails to initialize. The reason why I am asking is that upgrading OS should not remove any existing file on the inetsrv directory. If the file exists but you still get the failure. you should double-check what path is used for the aspnetcore.dll file in the %SystemRoot%\system32\inetsrv\config\applicationhost.config file. If it points to a different path, you need to check if the configured path is valid or not. Basically I want to understand what really happend.
If the file exists and the configured path is valid, we can't say IIS configuration was reset by upgrading OS and there might be something else is going.

@realwarder

For me, I was on 10586. IIS installed. Vs2015 release installed, upgraded over time to latest patch. Installed .net core release only.

Windows then updated itself to 14393. Then I had the issue with IIS and .net core and had to reinstall that to fix. All on 64bit.

@jhkimnew
jhkimnew commented Sep 27, 2016 edited

@realwarder, Can you reproduce the issue again? If so, the same question to you as well. In order for me to understand this issue, please tell me if the %SystemRoot%\system32\inetsrv\aspnetcore.dll file exists or not when IIS fails to initialize. The reason why I am asking is that upgrading OS should not remove any existing file on the inetsrv directory. If the file exists but you still get the failure. you should double-check what path is used for the aspnetcore.dll file in the %SystemRoot%\system32\inetsrv\config\applicationhost.config file. If it points to a different path, you need to check if the configured path is valid or not. Basically I want to understand what really happend. If the file exists and the configured path is valid, we can't say IIS configuration was reset by upgrading OS and there might be something else is going.

@jhkimnew
jhkimnew commented Sep 27, 2016 edited

@realwarder @FlapperMK
This is for your information. The aspnetcore.dll is installed when you install Aspnet Core. The Aspnet Core is one of the packages included in the .Net Core VS tooling.
If your machine has IIS installed, the Aspnet Core setup will install the aspnetcore.dll to both IISExpress and IIS directory. If your machine has no IIS installed, the Aspnet Core setup will install aspnetcore.dll only to IISExpress directory.

In my test machine, aspnetcore.dll file was not deleted after the OS update installation. I don't see any reason why the file is removed unless you unintentionally invoke the Aspnet Core setup to uninstall aspnetcore.dll.

If anyone can tell the repro steps, please let me know and I will check what is causing the problem. So far, I don't see any consistent repro steps and trying to understand what really happens.
First of all, I'd like to check if the file was removed or not to make sure the error message is not a false alarm.

@Tratcher
Member

We should also check for missing schema files and applicationhost.config entries. @jhkimnew can you describe where to look for those?

@jhkimnew
jhkimnew commented Sep 27, 2016 edited

Here is the schema file information.

For IISExpress:
"%ProgramFiles%\IIS Express\config\schema\aspnetcore_schema.xml"

For IIS:
"%windir%\system32\inetsrv\config\schema\aspnetcore_schema.xml"

Here is the aspnetcore file information.

For IISExpress (x86/amd64):
"%ProgramFiles%\IIS Express\aspnetcore.dll"
"%ProgramFiles(x86)%\IIS Express\aspnetcore.dll"

For IIS (x86/amd64):
"%windir%\system32\inetsrv\aspnetcore.dll"
"%windir%\syswow64\inetsrv\aspnetcore.dll"

And here is the configuration file information for the aspnetcore.dll module.

For IIS:
The aspnetcore.dll module is configured at %windir%\system32\inetsrv\config\applicationhost.config file. You can search "aspnetcore.dll" file from the file.

For IISExpress:
The aspnetcore.dll module is configured at .vs\config\applicationhost.config. The applicationhost.config won't exist by default. The file is created when you start any existing web application project of the VS solution. You can search "aspnetcore.dll" file from the file.

@FlapperMK
FlapperMK commented Sep 27, 2016 edited

@jhkimnew I don't know for sure what was missing prior to the repair as I've now repaired the installation. Currently, %SystemRoot%\system32\inetsrv\aspnetcore.dll is present on the affected PC. Both of the schema files are also now present.

the event log at the time simply show this.

Log Name:      Application
Source:        Microsoft-Windows-IIS-W3SVC-WP
Date:          22/09/2016 12:05:19
Event ID:      2280
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      ********
Description:
The Module DLL C:\WINDOWS\system32\inetsrv\aspnetcore.dll failed to load.  The data is the error.
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-Windows-IIS-W3SVC-WP" Guid="{670080D9-742A-4187-8D16-41143D1290BD}" EventSourceName="W3SVC-WP" />
    <EventID Qualifiers="49152">2280</EventID>
    <Version>0</Version>
    <Level>2</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2016-09-22T11:05:19.472744500Z" />
    <EventRecordID>1489</EventRecordID>
    <Correlation />
    <Execution ProcessID="0" ThreadID="0" />
    <Channel>Application</Channel>
    <Computer>********</Computer>
    <Security />
  </System>
  <EventData>
    <Data Name="ModuleDll">C:\WINDOWS\system32\inetsrv\aspnetcore.dll</Data>
    <Binary>7E000000</Binary>
  </EventData>
</Event>
@jhkimnew

@FlapperMK,
Can you check the setup log files with searching "aspnetcoremodule"?
You can do that with running the following command.

cd %temp%
findstr /spi aspnetcoremodule *

In normal situation, there should be log entries for installing AspNetCoreModule_x64 package.
The command result will show the file name (Ex: dd_DotNetCoreTools__20160926140846.log) as the below screenshot which I got from my test machine and you can open the log file with any text editor program. With reading the setup log file content with the keyword aspnetcoremodule, you can check what happened to the AspNetCoreModule package setup program while before/after updating OS.

<><><>Example of the findstr command result:
...
dd_DotNetCoreTools__20160926140846.log:[14D4:14D8][2016-09-26T14:08:47]i101: Detected package: AspNetCoreModule_x64, state: Absent, cached: None
...
<><><>

@reijerh
reijerh commented Sep 28, 2016

I had the same problem, solution was indeed to repair the install of Microsoft .NET Core 1.0.1 - VS 2015 Tooling Preview 2.

Here is my output of findstr /spi aspnetcoremodule * before repairing:

dd_DotNetCoreTools__20160920111929.log:[2AB0:18E4][2016-09-20T11:19:29]i101: Detected package: AspNetCoreModule_x86, state: Absent, cached: None
dd_DotNetCoreTools__20160920111929.log:[2AB0:18E4][2016-09-20T11:19:29]i101: Detected package: AspNetCoreModule_x64, state: Present, cached: Complete
dd_DotNetCoreTools__20160920111929.log:[2AB0:18E4][2016-09-20T11:19:31]i201: Planned package: AspNetCoreModule_x86, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None
dd_DotNetCoreTools__20160920111929.log:[2AB0:18E4][2016-09-20T11:19:31]i201: Planned package: AspNetCoreModule_x64, state: Present, default requested: Present, ba requested: Present, execute: None, rollback: None, cache: No, uncache: No, dependency: Register
dd_DotNetCoreTools__20160920111929.log:[2530:1988][2016-09-20T11:19:33]i325: Registering dependency: {b837b432-47cc-42bf-88e4-876d726dfb7c} on package provider: IIS_AspNetCore_Module,x64, package: AspNetCoreModule_x64
dd_DotNetCoreTools__20160920112251.log:[0BB0:0548][2016-09-20T11:22:51]i101: Detected package: AspNetCoreModule_x86, state: Absent, cached: None
dd_DotNetCoreTools__20160920112251.log:[0BB0:0548][2016-09-20T11:22:51]i101: Detected package: AspNetCoreModule_x64, state: Present, cached: Complete
dd_DotNetCoreTools__20160920112251.log:[0BB0:0548][2016-09-20T11:22:51]w327: Will not uninstall package: AspNetCoreModule_x64, found dependents: 1
dd_DotNetCoreTools__20160920112251.log:[0BB0:0548][2016-09-20T11:22:51]i201: Planned package: AspNetCoreModule_x64, state: Present, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: Unregister
dd_DotNetCoreTools__20160920112251.log:[0BB0:0548][2016-09-20T11:22:51]i201: Planned package: AspNetCoreModule_x86, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: Unregister
dd_DotNetCoreTools__20160920112251.log:[00E8:1294][2016-09-20T11:22:52]i326: Removed dependency: {9b3936b0-e973-47b9-afb2-de7cd6501203} on package provider: IIS_AspNetCore_Module,x64, package AspNetCoreModule_x64

Both the schema and aspentcore.dll were present on disk and applicationHost.config pointed to the right location.

The error code in the event log for The Module DLL C:\WINDOWS\system32\inetsrv\aspnetcore.dll failed to load. The data is the error. is: <Binary>7E000000</Binary>

@FlapperMK

@jhkimnew here's my output

dd_DotNetCoreTools__20160922122518.log:[3644:372C][2016-09-22T12:25:19]i101: Detected package: AspNetCoreModule_x86, state: Absent, cached: None
dd_DotNetCoreTools__20160922122518.log:[3644:372C][2016-09-22T12:25:19]i101: Detected package: AspNetCoreModule_x64, state: Present, cached: Complete
dd_DotNetCoreTools__20160922122518.log:[3644:372C][2016-09-22T12:25:21]i000: Setting string variable 'WixBundleLog_AspNetCoreModule_x64' to value 'C:\Users\jdunn\AppData\Local\Temp\dd_DotNetCoreTools__20160922122518_002_AspNetCoreModule_x64.log'
dd_DotNetCoreTools__20160922122518.log:[3644:372C][2016-09-22T12:25:21]i201: Planned package: AspNetCoreModule_x86, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None
dd_DotNetCoreTools__20160922122518.log:[3644:372C][2016-09-22T12:25:21]i201: Planned package: AspNetCoreModule_x64, state: Present, default requested: Repair, ba requested: Repair, execute: Repair, rollback: None, cache: No, uncache: No, dependency: Register
dd_DotNetCoreTools__20160922122518.log:[319C:10BC][2016-09-22T12:26:38]i304: Verified existing payload: AspNetCoreModule_x64 at path: C:\ProgramData\Package Cache{A0845055-ED2B-41CF-B799-A5765C485F29}v0.9.1965\packages\aspnetcoremodule_x64_en_rc2_14.msi.
dd_DotNetCoreTools__20160922122518.log:[319C:377C][2016-09-22T12:29:28]i301: Applying execute package: AspNetCoreModule_x64, action: Repair, path: C:\ProgramData\Package Cache{A0845055-ED2B-41CF-B799-A5765C485F29}v0.9.1965\packages\aspnetcoremodule_x64_en_rc2_14.msi, arguments: ' ARPSYSTEMCOMPONENT="1" MSIFASTINSTALL="7"'
dd_DotNetCoreTools__20160922122518.log:[3644:372C][2016-09-22T12:29:33]i319: Applied execute package: AspNetCoreModule_x64, result: 0x0, restart: None
dd_DotNetCoreTools__20160922122518.log:[319C:377C][2016-09-22T12:29:33]i325: Registering dependency: {22041006-8484-4b8d-a13c-40189695de2f} on package provider: IIS_AspNetCore_Module,x64, package: AspNetCoreModule_x64
dd_DotNetCoreTools__20160922122518.log:[3644:372C][2016-09-22T13:32:49]i410: Variable: WixBundleLog_AspNetCoreModule_x64 = C:\Users\jdunn\AppData\Local\Temp\dd_DotNetCoreTools__20160922122518_002_AspNetCoreModule_x64.log

@HolisticDeveloper

@jhkimnew In my case, I have never built an ASP.NET Core app even though the tooling was installed on my machine. I had Windows 7 x64 with an ASP.NET 4.0 app, running in a 32-bit application pool. After upgrading to Windows 10, any attempt to load an app in this pool resulted in the error. I believe that when I disabled the 32-bit option that the error went away, although this wasn't a good fix for me as my app requires loading as 32-bit. Hope this helps.

@jhkimnew

@reijerh The last line of your output has one interesting hint to the problem you ran int.
For some reasons, the aspnetcoremodule was uninstalled (got removed).
Would you attach the dd_DotNetCoreTools__20160920112251.log file so that we can check why it was removed?

@reijerh
reijerh commented Sep 29, 2016 edited

Sure, had to add the .txt extension to upload. Also removed my username from the paths in the log.

dd_DotNetCoreTools__20160920112251.log.txt

@joeloff
joeloff commented Sep 29, 2016

@reijerh can you please attach all the logs for the install (everything under %temp% that starts with dd_DotNetCoreTools)

@reijerh
reijerh commented Sep 30, 2016 edited

Yep, note that I've already repaired Tooling Preview 2 by now.

aspnetcore.zip

@MelbourneDeveloper

I just sucked down a Windows 10 update, and now IIS does not work at all. I get this error in the Event Viewer when I try to his any site that I have configured in IIS:

The Module DLL C:\WINDOWS\system32\inetsrv\aspnetcore.dll failed to load. The data is the error.

@VsMaX
VsMaX commented Oct 4, 2016

I am having exactly the same issue. One application pool stops working after few seconds each time I start it. The error log indicates: The Module DLL C:\WINDOWS\system32\inetsrv\aspnetcore.dll failed to load. I installed ASP .NET Core Visual Studio update yesterday.

@MelbourneDeveloper

If you use only Asp.Net, you donโ€™t need the aspnetcore.dll module and the best work-around is to remove that setting.

I think you've missed something here. I may or may not have used ASP.NET Core as a part of IIS in the past, but I haven't changed any settings manually. Some Windows update has sucked down something that screwed IIS up.

The only way I could fix the problem was to completely uninstall IIS, ASP.Net, restart my computer, then reinstall and restart again.

@Rick-Anderson Rick-Anderson added a commit to aspnet/Docs that referenced this issue Oct 5, 2016
@GuardRex @Rick-Anderson GuardRex + Rick-Anderson Add location information to ANCM hosting doc (#1944)
* Add location information to ANCM hosting doc

Fixes #1931 ... also updated capitalization of "h" of `applicationhost.config` to `applicationHost.config`.

Adds ANCM module, schema, and `applicationHost.config` locations to the doc for easy dev reference.

All credit to @jhkimnew for excellent post at aspnet/Home#1583 (comment)

* Minor update

Consistency: `IIS Express` (with space) is better than `IISExpress`.
a97b5c3
@jhkimnew
jhkimnew commented Oct 5, 2016 edited

@reijerh We checked the log file. All the log files you sent was created after 9/20/2016.

With reading the log file, we noticed you upgarded 1.0.0 to 1.0.1 on 9/20 and repaired 1.0.1 on 9/28.
On 9/20, there was no action done regarding the aspnetcore.dll and we could not find any evidence why the aspnetcore.dll file was corrupted or removed.
1.0.0 and 1.0.1 have the same version of aspnetcore.dll and we don't uninstall/install for the file while upgrading 1.0.0 to 1.0.1.
So, I guess you uninstalled the aspnetcore.dll file before 9/20.
Did you send all the log files? Obviously you did not send the log files when you install 1.0.0 which happens before 9/20. In order to understand what really happens, we need all the log files.
If you did not clean up the log files, would you create another zip file which include all the log files (.log) of which file name starts with "dd_" so that we can understand what happened before 9/20?

@MelbourneDeveloper

What is %temp%?
What is ANCM?

Basically, I've got no idea. I have installed ASP.Net Core previews in the past. But, as of the other day, IIS was completely fried - not just for Core instances - all instances. That's all I know.

@MelbourneDeveloper
MelbourneDeveloper commented Oct 6, 2016 edited

OK. Here are my logs:
https://dl.dropboxusercontent.com/u/79781769/Logs.7z

As for this ANCM thing of which you speak, I have installed multiple things. Quite often, VS will tell me "There is a new version of .NET Core available" so I follow the link, and it doesn't work. So, then I google and hunt down some other installer that may or may not work.

@MelbourneDeveloper

I didn't miss anything. That's all that was there.

@MelbourneDeveloper
MelbourneDeveloper commented Oct 6, 2016 edited

No. That's not the case. There are no other users on my machine.

It's too late now. IIS got fried. Lots of people are going to cop it.

No use crying over spilled milk now. People just need to totally uninstall IIS and reinstall.

@jhkimnew
jhkimnew commented Oct 6, 2016 edited

@MelbourneDeveloper Sorry but I decided to delete my writing about the work-around because it seems to cause some confusion before the root cause is figured out. I will write another one after the root cause is figured out.

@reijerh
reijerh commented Oct 6, 2016 edited

@jhkimnew sorry, this is all there is in my %temp% that starts with dd_dotnetcoretools. Oh wait you want everything that starts with dd_, one moment.

Edit: here it is, dd.zip

Sorry about the files' modified timestamps being modified by anonymization.

@jhkimnew
jhkimnew commented Oct 6, 2016

@reijerh It seems you lost the log files regarding 1.0.0. We could not find any information why the aspnetcore.dll was not able to be loaded on your machine with the provide log files.

@jhkimnew
jhkimnew commented Oct 6, 2016 edited

If anyone run into the issue again, before repairing the .NetCore tooling, please gather following information and send us so that we can figure what is going on when the issue is still happening.

  1. The full event error message
    (FYI, With the event error, we can determine which aspnetcore.dll file is causing the problem, either %windir%\system32\inetsrv\aspnetcore.dll or a different one on other directory)
  2. Please confirm if the aspnetcore.dll file which was shown on the event error is not existing or not. You can simply run "dir [the filepath of aspnetcore.dll]" in order to get that information. If the problematic aspnetcore.dll path started from the %windir%\system32\inersrv directory and your machine has 64bit OS is installed, please confirm if %windir%\syswow64\inetsrv\aspnetcore.dll file is existing or not as well.
  3. Please confirm if the aspnetcore_schema.xml file is existing or not. The schema file is placed at โ€œ%windir%\System32\inetsrv\config\schemaโ€ for IIS or "%ProgramFiles%\IIS Express\config\schema" for IISExpress
    (FYI, weโ€™d like to know if only aspnetcore.dll is deleted or its schema file is also deleted together)
  4. Please tell which applicatiohost.config file has the problematic aspnetcore.dll file configuration setting, either %windir%\system32\inetsrv\config\applicationhost.config or "your solution path".vs\config\applicationhost.config. You can open the file with notepad.exe and search aspnetcore.dll to find that information.
  5. Please tell when this issue happens from the following cases:
    1. After installing new Windows 10 Update
    2. After upgrading OS from downlevel version OS
    3. After installing other software package such as a new version of .NetCore
  6. If you run into this issue after installing new Windows 10 Update or after upgrading OS from downlevel version OS, please inform us what OS and what OS version you had before the upgrading OS
  7. If you run into this issue after installing new Windows 10 Update or after upgrading OS from downlevel version OS, please send the %windir%\iis.log file, which is the IIS setup log file with some detailed information of IIS setup activity during the OS upgarde
  8. If, before this issue happens, you were using aspnetcore.dll, please tell us from which way you installed the aspnetcore.dll file from the following cases:
    1. I installed the latest .NetCore tooling or other old version
    2. I installed old version of .NetCore tooling (or different name package) setup program
    3. I downloaded ANCM (AspNetCore module) setup program (.msi) and run the setup program to install the aspnetcore.dll
    4. I copied the aspnetcore.dll file from a different machine to my machine and configure it manually by myself without running any other setup program
    5. I never installed it
    6. I donโ€™t know if I installed it or not
@BryanTheCrow

@jhkimnew If you want to reproduce yourself, it's fairly simple and happens 100% of the time when upgrading from one BUILD of Windows 10 to a newer build (not to be confused with installing a cumulative update) if you've already got the latest VS & tooling installed, and are running your site in IIS in a 32bit app pool. Ex: Upgrade from 1511 to 1607 (which is what most in this thread did to run into this issue... though if you look at the start of the thread you'll see several of us warning this would be a problem when we ran into this with every new build released to the insider program before 1607 launched). If you're already on 1607, easiest way to reproduce is to join the insider program and update to the latest insider build. It will happen. I'm not sure the .net core logs will show you anything as the problem happens when updating windows builds, not when installing .net core. Repairing .net core always fixes it.

To reproduce from scratch (or, say, in a VM):

  1. Install Windows 10 1511 or earlier.
  2. Add IIS & .Net & MVC.
  3. Install Visual Studio 2015 & all MVC tooling updates (this will install aspnetcore).
  4. Build a demo MVC app and install it in IIS, setting its app pool to run in 32bit mode.
  5. At this point, everything should work perfectly.
  6. Using Windows Update, Update to Windows 10 1607.
  7. Profit. Or rather... enjoy experiencing this bug the first time you try to run the 32bit mvc site (which doesn't even need/use .netcore).
@Tratcher
Member
Tratcher commented Oct 6, 2016

@BryanTheCrow this does not reproduce on all machines. I have two that update weekly that this hasn't happened on.

@BryanTheCrow

@Tratcher Interesting. Let's try to nail down the difference. On those machines that update builds recently, do you also:

  1. Have Visual Studio 2015 + Update 3 + MVC + Tooling Updates (which include dotnetcore) installed?
  2. Have IIS Installed
  3. Have an MVC (not dotnetcore) site configured in IIS
  4. Use a 32bit App Pool for that site
@Tratcher
Member
Tratcher commented Oct 6, 2016

1 yes, 2 yes, 3 no - I primarily test core sites. 4 no.

@jhkimnew
jhkimnew commented Oct 6, 2016 edited

@BryanTheCrow If you can reproduce the issue, would you gather the information I asked above? And please observe how the aspnetcore.dll file is changed before/after upgrading OS. In order to observe that, you will need to check if your machine has both %windir%\system32\inetsrv\aspnetcore.dll and %windir%\syswow64\inetsrv\aspnetcore.dll before upgrading OS and write down the file size. And then compare it after upgrading OS.

@BryanTheCrow

@Tratcher Pretty sure this only affects 32bit dotnetcore.dll. I wonder if you switched one of your site's iis app pools to 32bit if you could reproduce on one of those machines? If not, the regular mvc app may be a requirement.

@jhkimnew I wasn't planning on running insider builds again for a few months (I like to wait until the new features are out and things aren't so unstable). While it's easy to reproduce by doing what I laid out above, it does take a few hours to go through the set up installations and I don't really have time right now.

As you appear to be the one researching a fix, I just assumed you'd like to reproduce for yourself. If not, the next time I do install a new build, I'll check back in to see if nobody else has reproduced & will post responses to all your questions above.

@jhkimnew
jhkimnew commented Oct 7, 2016 edited

@BryanTheCrow What is dotnetcore.dll? Maybe typo for aspnetcore.dll?
In the meantime, would you send the %windir%\iis.log on your machine and please inform when you upgraded OS so that we can take a look what happened on that day with the IIS setup log.
And please explain what I need to do for the "MVC + Tooling Updates" from the repro step of "Visual Studio 2015 + Update 3 + MVC + Tooling Updates".
There are couple of Tooling bundle package builds and so I'd like to follow the exactly same steps what you did and that's why I want the detailed information how to do that.

@BryanTheCrow

@jhkimnew Yes, sorry... typing quickly off memory. My mistake.

Sorry my memory is a little fuzzy as I didn't explicitly try to install ASP.Net Core. It came with one of the other updates or maybe even with the initial install of VS2015. I don't think it matters how you install it, just that you install it... That said, here are the steps as I remember them... many of these steps may not be necessary to reproduce, but in the interest of being complete I'll include them:

  1. On Win 10 Pro (pre rs1 release), using Turn Windows features/on/off, and config with the following checked (skip Hyper-V if you like. I know I've run into this with/without it):
  2. Install Visual Studio 2015 w/ Update 3 & update to latest releases by following the update prompts via the extensions & updates dialog (and the little flag in the upper right)... I recall an Azure update was required. That may have installed aspnetcore... I don't remember explicitly installing it... I think it came bundled with VS 2015 or with one of the initial tooling updates. I'm using VS Enterprise, in case that makes a difference.
  3. Using VS 2015's Extensions and Updates dialog, double check to make sure you have Microsoft ASP.NET and Web Tools, and Microsoft ASP.NET Web Frameworks and Tools installed (I remember these already being installed when installing VS2015, but I might be wrong, so it's worth double-checking). If not, install them.
  4. Using Web Platform Installer Install MVC3 Language Pack Installer and URLRewrite 2.0
  5. Reboot.
  6. Using Windows Update, install security updates (but don't update builds yet).
  7. Config a basic MVC 4 site (ex: the template/demo app) in IIS.
  8. Set its app pool to run in 32bit mode.
  9. Verify it works.

At that point, the only step needed to reproduce for me was to go through the windows update process to upgrade to a new build. After updating, I'd get errors trying to load both the DotNetCore module and the URLRewrite module, killing the app pool when first trying to load a page. Running a repair on both in "Add/Remove Programs" fixes them.

@BryanTheCrow

Here's my current IIS Log. I'm not 100% certain, but I believe I did a clean install of 1607 when it came out and re-configured from scratch, so I'm not sure this will be helpful.

iislog.zip

@joeloff
joeloff commented Oct 7, 2016

I wonder if it's worth looking at %windir%\Windowsupdate.log to see if there's any traces showing what the upgrade modified on the machine. IIS is an OS feature, so it's possible that upgrading the OS could impact that and may not necessarily honor additional items that were installed, like ANCM.

@BryanTheCrow
BryanTheCrow commented Oct 7, 2016 edited

it's possible that upgrading the OS could impact that and may not necessarily honor additional items that were installed, like ANCM.

@joeloff that certainly seems to be what's happening here as it affects URLRewrite 2.0 too. Modules installed via "Turn Windows Features On / Off" have no problem. But something in the build update process appears to kill some, but not all, modules, when trying to use them in a 32bit app pool.

@jhkimnew
jhkimnew commented Oct 8, 2016

@BryanTheCrow Okay, I found a consistent repro step with following your repro steps. Thanks a lot for your help. I was able to reproduce this issue with my machine. When this issue happens, the aspnetcore.dll on %windir%\syswow64\inetsrv directory is gone after upgrading OS.
I will investigate further with the help of IIS team regading upgarding OS and update you about this issue soon.

@BryanTheCrow

@jhkimnew Glad to hear it. Hopefully it'll turn out to be something simple. ๐Ÿ‘๐Ÿป

@HolisticDeveloper

Seems like IIS needs a better error message with the correct file path! :)

@DanTup
DanTup commented Oct 15, 2016

I had this on non-Insiders Windows 10 Anniversary. Reinstalling aspnet core did not fix it, but uninstalling every aspnet core item from Programs and Features did.

Seems like this is breaking real production machines - I lost several hours trying to fix this while I was supposed to be doing urgent work. I don't believe I even chose to put preview stuff on my production machine; VS did it?

@BryanTheCrow

@DanTup Yes, any windows 10 build update triggers this (anniversary update included). The insider updates are just the easiest way to reproduce for those who're already on 1607 as they come out with a new build weekly, vs bi-annually.

Repairing "Microsoft .NET Core 1.0.1 - VS 2015 Tooling Preview 2" via "Programs and Features" fixes it without needing to uninstall every item (though, that will work too).

@DanTup
DanTup commented Oct 17, 2016

@BryanTheCrow It's concerning that such a critical bug has been known about for months and is affecting production machines (and from the tweet I had from @shanselman I'm not even sure if the aspnet team realise it's affecting non-Insiders! I replied but got no response..).

Repair did not seem to work for me; tried several times including reboots :-(

My faith in the quality of code from MS sinks every month; we spend more time than ever fighting issues that aren't our own and nobody seems to care :-/

@BryanTheCrow

Fret not, @DanTup. @jhkimnew (above) has recently confirmed / reproduced and is working with the various teams involved to get to the bottom of it. I'm optimistic they'll have a fix before 1703 rolls out.

@shirhatti
Member
shirhatti commented Oct 18, 2016 edited

Thanks to all the folks who reported the issue.

Root cause

There is a bug in the IIS upgrade path. Non-OS files in the C:\Windows\SysWOW64\inetsrv directory are not preserved during an OS upgrade. If you have any IIS modules that didn't ship as part of Windows and drop files in the inetsrv directory, they will be broken. ASP.NET Core Module, HTTP Platform Handler, URL Rewrite, SEO optimization toolkit are IIS modules that will break during the OS upgrade. It is possible to encounter this issue if you use other third-party modules as well.

When do I encounter this issue?

If you had any of the aforementioned modules installed prior to your OS upgrade and then try to run any Application Pool in 32-bit mode after your OS upgrade.
You will encounter this issue even if your application does not use an unavailable module.

What's the work around?

Repair all the modules what were clobbered during your OS upgrade.

How do I know what modules are missing?

You should see an error raised in the Event viewer

Log Name:      Application
Source:        Microsoft-Windows-IIS-W3SVC-WP
Date:          10/17/2016 5:42:22 PM
Event ID:      2280
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      repro-machine
Description:
The Module DLL C:\WINDOWS\system32\inetsrv\rewrite.dll failed to load.  The data is the error.
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-Windows-IIS-W3SVC-WP" Guid="{670080D9-742A-4187-8D16-41143D1290BD}" EventSourceName="W3SVC-WP" />
    <EventID Qualifiers="49152">2280</EventID>
    <Version>0</Version>
    <Level>2</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2016-10-18T00:42:22.911610400Z" />
    <EventRecordID>589</EventRecordID>
    <Correlation />
    <Execution ProcessID="0" ThreadID="0" />
    <Channel>Application</Channel>
    <Computer>repro-machine</Computer>
    <Security />
  </System>
  <EventData>
    <Data Name="ModuleDll">C:\WINDOWS\system32\inetsrv\rewrite.dll</Data>
    <Binary>7E000000</Binary>
  </EventData>
</Event>

When will you actually fix it?

We are testing a fix right now, I'll update this space when I can share a concrete date/Windows build in which it will be fixed

This issue has been fixed in Windows Insider Build 15002

@shirhatti
Member

Worth pointing that even though the error message reads "The Module DLL C:\WINDOWS\system32\inetsrv\rewrite.dll failed to load", the actual missing file is C:\WINDOWS\syswow64\inetsrv\rewrite.dll. Accesses to system32 directory by the 32-bit IIS worker process are redirected to syswow64.

@GMZ
GMZ commented Oct 18, 2016

Just as ran across this issue and what fixed this for me was to edit the app pool (default)
image
disabling 32 apps recycle the app pool and it worked. stoped the app pool again re-enable 32 bit support and it still works, is it possible the something was just not set correctly post win 10 anniversary update?

@shirhatti
Member

@GMZ Sounds like your worker process has not been restarted after re-enabling 32 bit support. Try to force the AppPool recycle and you should still see this issue persist.

@zsy619
zsy619 commented Oct 20, 2016

https://www.microsoft.com/net/core#windows
ไธ‹่ฝฝ
.NET Core 1.0.1 - VS 2015 Tooling Preview 2
ๅนถๅฎ‰่ฃ…

@shirhatti shirhatti referenced this issue in aspnet/AspNetCoreModule Oct 26, 2016
Closed

OS upgrade breaks ANCM #4

@shirhatti
Member

This issue has been fixed in Windows Insider Build 15002

@shirhatti shirhatti closed this Jan 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment