I am trying to create very simple content in ~ / View.cshtml consisting of
@inherits ViewPage ο»Ώ @{ Layout = "SimpleLayout"; ViewBag.Title = "Title"; } <div id="content-page"> <p>Test</p> </div>
at ~ / Views / Shared / SimpleLayout.cshtml
<!DOCTYPE HTML> <html> <head> <title>Simple Layout</title> </head> <body> <div id="content"> @RenderBody() </div> </body> </html>
In debug mode it works fine, but when deployed, it shows
Compilation error
Description: An error occurred while compiling the resource required to service this request. Review the following specific error details and modify the source code accordingly.
Compiler Error Message: CS0146: Dependence of a circular base class using "RazorOutput.ViewPage" and "RazorOutput.ViewPage"
I try to follow the RockStars example as close as possible, so I donβt know what happened. My services work great.
Any suggestions would be appreciated.
Update
If the page name is changed (for example, NewPage.cshtml), then it will also not work in Debug, causing the same exception.
source share