Yousuf Yousuf - 4 days ago 4x
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

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": [