在IIS 8.5,Asp.net核心上部署应用程序
所有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())
>服务器上IIS_IUSRS用户帐户的所有权限
> CustomViewLocationExpander:
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
我对这一点毫无头绪.
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。