404在Azure上但不在本地开发计算机上 [英] 404 on Azure but not on local development machine

查看:59
本文介绍了404在Azure上但不在本地开发计算机上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将MVC项目从Asp.net 5 RC1-final迁移到了核心1.0.1.在我的开发机器上,一切运行正常,但是当我将其发布到Azure WebApp时,每条路径上都显示404.我试图调试该站点,但似乎找不到该视图.您知道这可能是什么,如何获得更详细的错误报告?

I migrated a MVC project from Asp.net 5 RC1-final to core 1.0.1. On my Development machine everything runs perfect but when I publish it to Azure WebApp I get a 404 on every route. I tried to debug the site and it seems that the View can not be found. Any idea what it could be or how I can get a more detailed error report?

推荐答案

错误是我没有在project.json中的publishOption下添加视图.

The Error was that I did not add the Views under publishOption in the project.json.

之前:

"publishOptions": {
"include": [
  "wwwroot",
  "web.config"
]
},

现在:

"publishOptions": {
"include": [
  "wwwroot",
  "Views",
  "web.config"
]
},

这篇关于404在Azure上但不在本地开发计算机上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆