Making MVC 6 deploy on IIS on Windows 10

▼魔方 西西 提交于 2019-12-12 12:29:54

问题


I'm using 1.0.0-rc1-update1 and on IIS Express it works fine, but when I deploy to IIS, I get a blank page. Nothing. No errors, nothing in the event log - this is the same problem even for a vanilla MVC6 web application, so I doubt it's my code!

I am pointing the application to the www folder under the published folder and I have my app pool set up for .net 4

Am quite used to getting errors out of IIS, but this is a new one on me! Would anyone be able to help? Or maybe at least point me at some log files?


回答1:


Thanks @Ruslan for your help here.

The link you provided had the answer off it as a "current word around for Beta8", which also appears to be a necessary work around for RC1!!!

https://github.com/aspnet/Hosting/issues/416

Basically, the "blank screen" I was getting was actually a 404 (I got more info by adding app.UseStatusCodePages(); to my startup.

The work around was to rename the Configure method (I called it Configure1 as per the link above) and to create a stub Configure method to call it indirectly via the app.Map() method:

    public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
    {
        app.Map("/GilLecORM", (app1) => this.Configure1(app1, env, loggerFactory));
    }

It now works - but clearly this is a fairly big problem for the RC :)



来源:https://stackoverflow.com/questions/34113152/making-mvc-6-deploy-on-iis-on-windows-10

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!