DavidT
DavidT

Reputation: 342

Asp.net Core + IIS 8.5 : The view 'Index' was not found

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:
Visual Studio 2015 project structure

Tested/Checked:

I can access all content freely on 'wwwroot' only js/images/css

I'm clueless on this one.

Upvotes: 5

Views: 2671

Answers (1)

DavidT
DavidT

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

Related Questions