404 on Azure but not on local development machine

元气小坏坏 提交于 2019-12-12 02:43:47

问题


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?


回答1:


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

Before:

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

Now:

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



回答2:


Check to see whether File Publish Option Remove Additional Files At Destination is checked. If it is not checked, check it and publish. It should delete all files at the destination and publish the upgrade.



来源:https://stackoverflow.com/questions/40781304/404-on-azure-but-not-on-local-development-machine

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