简体   繁体   中英

My: Server Error in '/' Application

I published my website to Staging and everything seems to be working perfectly, until I hit a button that shows me the following error:

Server Error in '/' Application.

The view 'Index' or its master was not found or no view engine supports the searched locations. The following locations were searched: ~/Views/Page/Index.aspx ~/Views/Page/Index.ascx ~/Views/Shared/Index.aspx ~/Views/Shared/Index.ascx ~/Views/Page/Index.cshtml ~/Views/Page/Index.vbhtml ~/Views/Shared/Index.cshtml ~/Views/Shared/Index.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 'Index' or its master was not found or no view engine supports the searched locations. The following locations were searched: ~/Views/Page/Index.aspx ~/Views/Page/Index.ascx ~/Views/Shared/Index.aspx ~/Views/Shared/Index.ascx ~/Views/Page/Index.cshtml ~/Views/Page/Index.vbhtml ~/Views/Shared/Index.cshtml ~/Views/Shared/Index.vbhtml

Secondly, I have the same error for a different website that I published to Release. One of the links to the page shows me the following error:

Server Error in '/' Application.

The view 'Unsubscribe' or its master was not found or no view engine supports the searched locations. The following locations were searched: ~/Views/Midpath/Unsubscribe.aspx

~/Views/Midpath/Unsubscribe.ascx

~/Views/Shared/Unsubscribe.aspx

~/Views/Shared/Unsubscribe.ascx

~/Views/Midpath/Unsubscribe.cshtml

~/Views/Midpath/Unsubscribe.vbhtml

~/Views/Shared/Unsubscribe.cshtml

~/Views/Shared/Unsubscribe.vbhtml

Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

These websites are working perfectly when run on the local machine. However, there are files that are missing after publishing these websites. I can see via FileZilla that few files are missing and i can drag and drop those files to azure folders but I don't want to do that at the first place. What if this error persists every time I publish my websites to either Staging or Release. My question is why these files are not being published with the other files in the first place.

Rather than publish to Azure you can publish to your local file system to easier see which files are missing.

In Visual Studio are you sure that file in question is included in the project - it might just exist on the file system (which is why your local dev version works) but is not included in the publishing manifest.

Locate the 'Unsubscribe' file in VS. If it's greyed out select the file and right click > 'Include In Project'. Also check the file properties. 'Build Action' should probably be 'Content'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM