Yousuf Yousuf - 1 year ago 124
ASP.NET (C#) Question

.net core mvc application error after publishing to iis

I am trying to host .net core mvc application in iis. When I publish I get below error -

An unhandled exception occurred while processing the request.

InvalidOperationException: The view 'Index' was not found. The
following locations were searched: /Views/Home/Index.cshtml

Set Set
Answer Source

You need to add Views folder to publishing. In you project.json file you have section publishOptions with subsection include. Add relative path to "Views" folder here

  "publishOptions": {
    "include": [
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download