[英]Black page or 404 every request in Asp.NET core
my Asp.NET Core project returns 404 with Postman or a blank page with a browser after every request. 我的Asp.NET Core项目在每次请求后都返回404(带有Postman)或空白页(带有浏览器)。 I'm using Asp.NET Core 1.1.2.
我正在使用Asp.NET Core 1.1.2。 I already tried to:
我已经尝试过:
Startup.cs, appsettings.json, web.config have not been edited. Startup.cs,appsettings.json,web.config尚未被编辑。
I have SSL enabled and HTTPS rewrite. 我已启用SSL和重写HTTPS。
This happenes on both IIS Express and the project directly. IIS Express和项目都直接发生这种情况。
Routing: 路由:
app.UseMvc(routes => {
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
Log: 日志:
So, the problem was Microsoft.AspNetCore.Mvc.Versioning. 因此,问题出在Microsoft.AspNetCore.Mvc.Versioning。 With version 1.1.x you need to add "app.UseApiVersioning()" in the configure method after app.UseMvc(...);
对于版本1.1.x,需要在app.UseMvc(...)之后的configure方法中添加“ app.UseApiVersioning()”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.