Launching MVC6 Beta8 Application on IIS Express

I just upgraded to MVC6 Beta8. A few hours after fixing the compilation code, I ran into problems that the application does not run in IIS Express. I get an error message:

[TypeLoadException: Failed to load type "Microsoft.Dnx.Host.Clr.EntryPoint" from the 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): Failed to load type 'Microsoft.Dnx.Host.Clr.EntryPoint' from the 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 (IIS7Workertt26 +26)

I know that there have been changes in the hosting architecture. But does this mean that we can no longer use IIS express, or is it just a change or configuration change?

+6
source share
4 answers

There are several changes to the IIS / IIS Express hosting model that you need to consider when upgrading to beta.

In the project.json file, remove them from the dependencies:

  • "Microsoft.AspNet.Server.IIS"
  • "Microsoft.AspNet.Server.WebListener"

Add the following to your dependencies:

  • "Microsoft.AspNet.Server.Kestrel"
  • "Microsoft.AspNet.IISPlatformHandler

Finally, in the Startup.cs file, add the following to the Configure method:

  • app.UseIISPlatformHandler();

(I assume that app is the name of your IApplicationBuilder, you can customize accordingly).

This will add a new IISPlatformHandler to the pipeline and direct traffic to the Kestrel server, therefore bypassing IIS and the old Helios dnx host.

You can read about this change in ads on Github.

+6
source

This is how I solved the problem:

I could not figure out how to modify an existing project.

+5
source

I had the same problem after upgrading to beta 8 and fixing it by removing the following project.json dependencies:

"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 project links from beta7 to beta8 .

Hope this helps.

+1
source

Here is my way. Someone might find something useful. I added these lines to my project. Json:

 "Microsoft.AspNet.IISPlatformHandler": "1.0.0-beta8", "Microsoft.AspNet.Server.WebListener": "1.0.0-beta8", "Microsoft.AspNet.Server.Kestrel": "1.0.0-beta8", 

And I changed the commands:

 "commands": { "web": "Microsoft.AspNet.Hosting --config hosting.ini", }, 

:

 "commands": { "web": "Microsoft.AspNet.Hosting server=Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000", "kestrel": "Microsoft.AspNet.Server.Kestrel", }, 

then dnu restore

Now you can start the asp.net application using the dnx web or dnx kestrel . The differences are described here: https://github.com/aspnet/Home/wiki/Servers

0
source

All Articles