After updating my app to beta7 I'm unable to run it from IIS Express using either view in browser or running it in the debugger it shows this exception in the browser but doesn't break on any exception in my code using the debugger:
[Exception: Unexpected application failure. Status code '-2147024894'.]
System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException) +361
[HttpException (0x80004005): Unexpected application failure. Status code '-2147024894'.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +579
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +120
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +712
I am able to run it using dnx web from the command line with no errors.
I tried with a new web app using the vs template and that one runs fine in IIS Express so it must be something specific about my app but I have no idea what since it doesn't break on any error in my code when running in the debugger.
Anyone have any idea what could be causing this or what kind of thing to check in my app or configuration to solve it?
Note that dnvm list shows my default runtime as beta7 coreclr x64 which is also what I have set as the specific runtime in the web app properties and in global.json
after much debugging I figured out that the problem was caused because it was not really launching the app with beta7, it was really using beta6 runtime even though the project, my profile, and global.json were all configured to use beta7.
The reason it was doing that was because there is a Web.config file in my wwwroot folder with the following appSettings:
<appSettings>
<add key="bootstrapper-version" value="1.0.0-beta6" />
<add key="dnx-version" value="1.0.0-beta6" />
<add key="dnx-clr" value="coreclr" />
</appSettings>
after updating those to beta7 it now works as it should in IIS.
the reason why it worked from the command line is because web.config is only used by IIS
I had the same issue. I installed a new runtime environment with the dot net version manager:
dnvm install latest -r coreclr -arch x64
which installed and used 1.0.0-beta7 coreclr x64
Then in my solution's global.json I set the sdk to the beta7 version
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-beta7"
}
}
and I was getting the [Exception: Unexpected application failure. Status code '-2147024894'.]
Your answer pointed me in the right direction. It was as if the IIS didn't match..
So I went to my project.json
and set the dependencies for the AspNet.Server to the right version 1.0.0-beta7
{
"webroot": "wwwroot",
"version": "1.0.0-*",
"dependencies": {
"Microsoft.AspNet.Server.IIS": "1.0.0-beta7",
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta7"
},
"commands": {
"web": "Microsoft.AspNet.Hosting --config hosting.ini"
},
"frameworks": {
"dnxcore50": { }
},
"publishExclude": [
"node_modules",
"bower_components",
"**.xproj",
"**.user",
"**.vspscc"
],
"exclude": [
"wwwroot",
"node_modules",
"bower_components"
]
}
and after that the application runs under iis express properly.
Please note that in VS2015 ASP.NET 5 projects the IIS Express configuration is at <path_to_solution>\.vs\config\applicationhost.config
althouhg it wasn't necessary to modify anything here as it's autogenerated folder.
Also I'm not sure why you had a configuration file under wwwroot folder but that doesn't seem to be a safe place to host configuration files as it's the static folder exposed by the webserver if I'm not mistaken.