Asp.net核心IIS 8.5:找不到视图“索引”
在IIS 8.5,Asp.net核心上部署应用程序
3个应用程序,前端,API和登录(在同一站点上); 所有3个都在VS2015的IIS Express中完美地工作; 前端(只有html / AngularJS)& API在IIS 8.5上运行良好 但是对于Login(IdentityServer4): InvalidOperationException: The view 'Index' was not found. The following locations were searched: - ~/UI/Home/Views/Index.cshtml - ~/UI/SharedViews/Index.cshtml 我明白’?/’是指批准; 我的VS2015结构: 经测试/检查: Program.cs中的.UseContentRoot(Directory.GetCurrentDirectory()) public class CustomViewLocationExpander : IViewLocationExpander { public IEnumerable<string> ExpandViewLocations(ViewLocationExpanderContext context,IEnumerable<string> viewLocations){ yield return "~/UI/{1}/Views/{0}.cshtml"; yield return "~/UI/SharedViews/{0}.cshtml"; } public void PopulateValues(ViewLocationExpanderContext context) { } } 我可以在’wwwroot’上免费访问所有内容js / images / css 我对这一点毫无头绪. 解决方法
我发帖前搜索了一个多小时.休息一下,发现了这个:
https://github.com/IdentityServer/IdentityServer4.Samples/issues/23 将“UI”添加到project.json中的发布选项 "publishOptions": { "include": [ "wwwroot","UI","YourCertificateName.pfx","web.config" ]} 精度:“UI”指包含我的视图的“root”文件夹.您必须将所有(根视图文件夹)包含在要导出的“publishOptions”中. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- asp.net – asp:ContentPlaceHolder和代码块问题
- 具有多个ASP.NET Web应用程序的Visual Studio解决方案
- asp.net-mvc – ASP.NET 4.5在调试模式下捆绑 – 陈旧资源
- asp.net – 内容控件必须是顶级控件
- asp.net – 使用字符串列表绑定GridView
- ASP.NET FileUpload – 如何更改“浏览…”按钮说明的语言?
- asp.net-mvc – ASP.NET MVC 4动作过滤器问题
- asp.net-mvc – 登录页面上的Asp.Net MVC捆绑
- asp.net-mvc – 将参数传递给telerik asp.net mvc grid
- asp.net – 如何.NET网站隐藏它们的文件的.aspx扩展名?
- asp.net-mvc – 我是否需要在Login操作上使用Val
- 单元测试 – 自动混合和WebApi控制器
- EFCore 5 新特性 SaveChangesInterceptor
- asp.net mvc errorhandler没有显示自定义错误页面
- asp.net – 在服务器而不是数据库中拥有(可能)数
- content is not supported outside 'script&
- asp.net – Azure AD B2C – 多个子域
- 处理asp.net core EF model 中有自增列的问题
- ASP.NET Core Web API
- asp.net – 如何修复在IIS中运行的Web服务中的“