Azure/C++/C#/Java/Asp.net/JavaScript/Html - MFC/COM/ActiveX/eclipse/Web

dlbrant

working soft

博客园 首页 新随笔 管理

Asp.Net MVC项目在编译代码同时编译View,需要手动修改Project文件。

 用Notepad或其他文本编辑器打开Project文件,或者直接在Visual Studio中Unload project,然后右键点Project,选择Edit Project菜单,

将 MvcBuildViews改为true,如下:

<MvcBuildViews>true</MvcBuildViews>

修改后保存并Reload project,此时编译代码的同时也会编译各个View。

 

如果出现如下编译错误 

 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

这不是代码错误引起的,看起来是编译的时候这个输出文件夹被当做一个IIS虚拟目录来对待,但当前的appplication确不是IIS上部署的应用。

 

解决办法: 

只需要将代码目录下的obj文件夹删掉,重现编译即可。 

posted on 2012-04-05 15:29  dlbrant  阅读(1545)  评论(3编辑  收藏  举报

Software