Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aspnetcore.dll failed to load #597 #1583

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

aspnetcore.dll failed to load #597 #1583

barrytang opened this issue Jun 20, 2016 · 89 comments
Assignees

Comments

@barrytang
Copy link

@barrytang barrytang commented Jun 20, 2016

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
Copy link
Author

@barrytang barrytang commented Jun 20, 2016

Opened on behalf of @teovc.

@Tratcher
Copy link
Contributor

@Tratcher Tratcher commented Jun 20, 2016

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

@teodoro-vargas
Copy link

@teodoro-vargas teodoro-vargas 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
Copy link
Contributor

@pan-wang pan-wang commented Jun 20, 2016

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"

@teodoro-vargas
Copy link

@teodoro-vargas teodoro-vargas 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
Copy link
Contributor

@pan-wang pan-wang commented Jun 20, 2016

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.

@teodoro-vargas
Copy link

@teodoro-vargas teodoro-vargas 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
Copy link
Contributor

@pan-wang pan-wang commented Jun 20, 2016

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
Copy link
Contributor

@pan-wang pan-wang commented Jun 20, 2016

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.

@teodoro-vargas
Copy link

@teodoro-vargas teodoro-vargas 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
Copy link

@edobnet edobnet commented Jul 5, 2016

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

@ghost
Copy link

@ghost ghost 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
Copy link

@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?

@teodoro-vargas
Copy link

@teodoro-vargas teodoro-vargas 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
Copy link

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

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
Copy link

@BryanTheCrow BryanTheCrow commented Jul 13, 2016

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
Copy link

@andreabalducci andreabalducci commented Jul 26, 2016

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

@MattMystic
Copy link

@MattMystic MattMystic commented Aug 2, 2016

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
Copy link

@Jmrizkallah Jmrizkallah commented Aug 5, 2016

Same here after updating to the anniversary update...

@bradfalk
Copy link

@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
Copy link

@JoshSchreuder JoshSchreuder commented Aug 9, 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.

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
Copy link

@frank3nst3in frank3nst3in commented Aug 9, 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.

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

@realwarder
Copy link

@realwarder realwarder commented Aug 15, 2016

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

@yzorg
Copy link

@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
Copy link

@gcy2 gcy2 commented Sep 9, 2016

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
Copy link

@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
Copy link

@morganpdx morganpdx commented Sep 14, 2016

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

@Tratcher
Copy link
Contributor

@Tratcher 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
Copy link

@BryanTheCrow BryanTheCrow commented Oct 6, 2016

@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
Copy link
Contributor

@Tratcher Tratcher commented Oct 6, 2016

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

@jhkimnew
Copy link
Contributor

@jhkimnew jhkimnew commented Oct 6, 2016

@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
Copy link

@BryanTheCrow BryanTheCrow commented Oct 7, 2016

@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
Copy link
Contributor

@jhkimnew jhkimnew commented Oct 7, 2016

@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
Copy link

@BryanTheCrow BryanTheCrow commented Oct 7, 2016

@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
Copy link

@BryanTheCrow BryanTheCrow commented Oct 7, 2016

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
Copy link
Contributor

@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
Copy link

@BryanTheCrow BryanTheCrow commented Oct 7, 2016

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
Copy link
Contributor

@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
Copy link

@BryanTheCrow BryanTheCrow commented Oct 9, 2016

@jhkimnew Glad to hear it. Hopefully it'll turn out to be something simple. 👍🏻

@HolisticDeveloper
Copy link

@HolisticDeveloper HolisticDeveloper commented Oct 9, 2016

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

@DanTup
Copy link

@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
Copy link

@BryanTheCrow BryanTheCrow commented Oct 17, 2016

@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
Copy link

@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
Copy link

@BryanTheCrow BryanTheCrow commented Oct 17, 2016

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
Copy link
Member

@shirhatti shirhatti commented Oct 18, 2016

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
Copy link
Member

@shirhatti shirhatti commented Oct 18, 2016

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
Copy link

@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
Copy link
Member

@shirhatti shirhatti commented Oct 18, 2016

@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
Copy link

@zsy619 zsy619 commented Oct 20, 2016

https://www.microsoft.com/net/core#windows
下载
.NET Core 1.0.1 - VS 2015 Tooling Preview 2
并安装

@shirhatti
Copy link
Member

@shirhatti shirhatti commented Jan 9, 2017

This issue has been fixed in Windows Insider Build 15002

@shirhatti shirhatti closed this Jan 9, 2017
ryanbrandenburg pushed a commit that referenced this issue Nov 27, 2018
- Doesn't consume new feature interfaces yet.
@msftbot msftbot bot locked as resolved and limited conversation to collaborators Dec 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.