无法加载资源:服务器响应状态为404(未找到)
在我的创业公司里面我有以下内容:
public voID Configure(IApplicationBuilder app){ app.UseDefaultfiles(new Microsoft.AspNet.Staticfiles.DefaultfilesOptions() { Defaultfilenames = new[] { "index.HTML" } }); app.UseMvc();}
有些原因我在调试时仍然得到一个空白的白页,没有任何加载.
解决方法 您还必须指定app.UseStaticfiles(). From the docs:总结In order for your Web app to serve a default page without the user having to fully qualify the URI,call the
UseDefaultfiles
extension method fromStartup.Configure
as follows. Note that you must still callUseStaticfiles
as well. This is becauseUseDefaultfiles
is a URL re-writer that doesn’t actually serve the file. You must still specify mIDdleware (UseStaticfiles
,in this case) to serve the file.
以上是内存溢出为你收集整理的c# – MVC6默认页面全部内容,希望文章能够帮你解决c# – MVC6默认页面所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)