0

when I run the application in VS,it is normal.But when I publish it to the server on IIS,there are two views throw exceptions like this:

Exception type: InvalidOperationException 
    Exception message: The view 'Error' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/View_AccountManage/Error.aspx
~/Views/View_AccountManage/Error.ascx
~/Views/Shared/Error.aspx
~/Views/Shared/Error.ascx
~/Views/View_AccountManage/Error.cshtml
~/Views/View_AccountManage/Error.vbhtml
~/Views/Shared/Error.cshtml
~/Views/Shared/Error.vbhtml

and at this moment,only when I visit these two views, it throw exception,other views is normal.And it is not always throw exception,only sometimes,and when I reset IIS it will be normal. I'm sure the view is in the right location,after all ,it can work right when I reset IIS. Please help me ,3Q!

gunmo
  • 11
  • 1
  • I am assuming there's a `Error.cshtml` file in your `/Views/Shared` directory? – Izzy Jun 12 '18 at 09:14
  • Possible duplicate of [The view or its master was not found or no view engine supports the searched locations](https://stackoverflow.com/questions/18273416/the-view-or-its-master-was-not-found-or-no-view-engine-supports-the-searched-loc) – Søren D. Ptæus Jun 12 '18 at 09:15
  • the view I want to visit is ~/Views/View_AccountManage/Create,but it can not redirect to the right view,why?And I reset the IIS,it can work right,but after a period of time,it will also throw exception . – gunmo Jun 12 '18 at 09:22
  • It would be awesome if you could provide a [mcve]. Alternatively, please show us **all** references to the word `Error` in your code, including the web.config. – mjwills Jun 12 '18 at 11:16

0 Answers0