ASP. net mvc project compilation View

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.