I just updated to MVC6 Beta8. After a few hours fixing the code to compile again, I run into an issues that the app does not run under IIS Express. I'm getting this error message:
[TypeLoadException: Could not load type 'Microsoft.Dnx.Host.Clr.EntryPoint' from assembly 'Microsoft.Dnx.Host.Clr, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.] System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException) +303
[HttpException (0x80004005): Could not load type 'Microsoft.Dnx.Host.Clr.EntryPoint' from assembly 'Microsoft.Dnx.Host.Clr, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9922864 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +90 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +261
I know there were changes to the hosting architecture. But does this mean that we can't use IIS express anymore or it's just a matter of update or configuration change?
There are a few breaking changes to the IIS/IIS Express hosting model that you need to account for when upgrading to beta8.
In your project.json file, remove these from dependencies:
Add the following to your dependencies:
Finally, in your Startup.cs file, add the following to the Configure method:
app.UseIISPlatformHandler();
(I'm assuming app
is the name of your IApplicationBuilder, you can adjust accordingly).
This will add the new IISPlatformHandler to the pipeline and directs traffic to the Kestrel server, therefore bypassing IIS and the old Helios dnx host.
You can read up on this change in the announcements on Github
Here is how I resolved the problem:
I could not figure out how to modify the existing project.
I had the same issue after upgrading to beta 8 and solved it by removing the following dependencies from project.json
:
"Microsoft.AspNet.Server.IIS": "1.0.0-beta7"
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta7"
And adding the following dependency:
"Microsoft.AspNet.Server.Kestrel": "1.0.0-beta8"
I also updated all the project references from beta7
to beta8
.
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With