Reputation: 342
Deployed App on IIS 8.5, Asp.net core
3 apps, Front-end, API and Login (on the same site);
All 3 are working PERFECTLY in IIS express from VS2015;
The front-end (only html/AngularJS) & API are working perfectly on IIS 8.5
But for the Login (IdentityServer4):
InvalidOperationException: The view 'Index' was not found. The following locations were searched:
- ~/UI/Home/Views/Index.cshtml
- ~/UI/SharedViews/Index.cshtml
I understand that '~/' refers to the approot;
My VS2015 structure:
Tested/Checked:
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)
{
}
}
I can access all content freely on 'wwwroot' only js/images/css
I'm clueless on this one.
Upvotes: 5
Views: 2671
Reputation: 342
I searched for more than an hour before posting. Took a break and found this :
https://github.com/IdentityServer/IdentityServer4.Samples/issues/23
add "UI" to the publish options in project.json
"publishOptions": {
"include": [
"wwwroot",
"UI",
"YourCertificateName.pfx",
"web.config"
]}
Precision : "UI" Refers to the 'root' folder containing my views. You have to include them all (root view folders) in "publishOptions" to be exported.
Upvotes: 5