Asp.net mvc 未找到视图索引或主视图azure部署问题
我是Azure部署的新手。我有一个Asp.net mvc 未找到视图索引或主视图azure部署问题,asp.net-mvc,deployment,azure-web-app-service,kudu,Asp.net Mvc,Deployment,Azure Web App Service,Kudu,我是Azure部署的新手。我有一个ASP.NET MVC应用程序运行良好,本地运行良好。正在尝试在Azure上部署它。使用BitBucket存储库创建应用程序。但访问它会给 The view 'Index' or its master was not found or no view engine supports the searched locations. The following locations were searched: ~/Views/User/Index.aspx ~/Vi
ASP.NET MVC
应用程序运行良好,本地运行良好。正在尝试在Azure上部署它。使用BitBucket
存储库创建应用程序。但访问它会给
The view 'Index' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/User/Index.aspx
~/Views/User/Index.ascx
~/Views/Shared/Index.aspx
~/Views/Shared/Index.ascx
~/Views/User/Index.cshtml
~/Views/User/Index.vbhtml
~/Views/Shared/Index.cshtml
~/Views/Shared/Index.vbhtml
我使用Kudu控制台
检查D:\home\site\repository
是否包含项目的每一部分。但是D:\home\site\wwwroot
未命中控制器
等
我认为它可以访问wwwroot
目录作为项目目录。但我对此不确定
任何实际问题和解决方案的指针都将受到高度赞赏
我使用Kudu控制台检查D:\home\site\repository是否包含项目的每一部分。但是D:\home\site\wwwroot未命中控制器等
正如我所知,对于经典的(无论.NET核心应用程序如何)ASP.NET MVC网站,控制器
将编译成带有web应用程序名称的.DLL文件。您可以通过KUDU在D:\home\site\wwwroot\bin
下找到它
找不到视图“索引”或其主视图,或者没有视图引擎支持搜索的位置
由于您的网站可以在本地工作,我假设您部署到Azure的web内容有问题。您可以尝试通过KUDU检查*.cshtml文件是否已成功部署到Azure(在D:\home\site\wwwroot\Views
下)
另外,请确保视图的生成操作已配置为“内容”,如下所示:
此外,如果要将应用部署到Azure Web App,您可以遵循此官方信息。感谢@Bruce抽出时间。它正在工作。实际上,我的VS有问题。另外,我按照构建操作
配置为内容
,这就解决了问题。