Home > database >  The view or its master was not found or no view engine supports the searched locations - Server Erro
The view or its master was not found or no view engine supports the searched locations - Server Erro

Time:04-01

Error like:The view 'Error' or its master was not found or no view engine supports the searched locations. The following locations were searched:

*

~/Views/Home/Error.aspx
~/Views/Home/Error.ascx
~/Views/Shared/Error.aspx
~/Views/Shared/Error.ascx
~/Views/Home/Value cannot be null.
Parameter name: source.master
~/Views/Shared/Value cannot be null.
Parameter name: source.master
~/Views/Home/Value cannot be null.
Parameter name: source.cshtml
~/Views/Home/Value cannot be null.
Parameter name: source.vbhtml
~/Views/Shared/Value cannot be null.
Parameter name: source.cshtml
~/Views/Shared/Value cannot be null.
Parameter name: source.vbhtml
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: The view 'Error' or its master was not found *or no view engine supports the searched locations. The following locations were searched:
*~/Views/Home/Error.aspx
~/Views/Home/Error.ascx
~/Views/Shared/Error.aspx
~/Views/Shared/Error.ascx
~/Views/Home/Value cannot be null.**

I have tried deploying this to CI/CD pipelines so getting error. Already confirmed that build action is set to Content

My Views heirarchy is:

Views
  Home
    ClaimsDetails.cs
 
  Shared
    _Layout.cshtml
      Error.cshtml

CodePudding user response:

Some of the workarounds that you can try are:

  • In your custom error handler that derives from 'HandleErrorAttribute,' don't call the 'base.OnException(context);' method. Because you've implemented custom error handling in 'Application Error,' you don't need it anymore.

  • Another option was to remove this from <system.web> in my web.config:

<customErrors mode="On" />
  • If your web.config doesn't have a customErrors , put one in explicitly with mode="Off"

Please go through these Similar SO threads for more information - Reference 1 , Reference 2, Reference 3

CodePudding user response:

The reason I got this error was the entry point is not in this web application. It needed some input parameters to get redirected to Azure app service. Thankyou!

  • Related