The ASP. net mvc project needs to manually modify the project file when compiling the code and compiling the view.
Open the project file using notepad or other text editors, or directly unload the project in Visual Studio, right-click the project, and select the edit project menu,
Change mvcbuildviews to true, as shown below:
<Mvcbuildviews> true </mvcbuildviews>
Save the modification and reload the project. The view is also compiled when the code is compiled.
If the following compilation error occurs:
Error 47 it is an error to use a section registered as allowdefinition = 'machinetoapplication' beyond application level. this error can be caused by a virtual directory not being configured as an application in IIS .... \ OBJ \ release \ csautoparameterize \ original \ Web. config
This is not caused by code errors. It seems that the output folder is treated as an IIS virtual directory during compilation, but the current appplication is indeed not an application deployed on IIS.
Solution:
You only need to delete the OBJ folder under the Code directory and reproduce the compilation.