asp.net mvc4 设置build项目时,编译view页面
2015-11-25 00:16
531 查看
新建好项目后,把system.web.mvc.dll移除,重新选择本地C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies下的system.web.mvc.dll,编译出现问题提示:“The type or namespace name 'Html' does not exist in the namespace 'System.Web.Mvc'”
切换回来对应新建时应用目录下的system.web.mvc.dll依然出现问题。
让view重新编译:
1,)修改web解决方案.csproj文件,
1.1,)设置MvcBuildViews属性为true;
1.2,)在</Project>前面加上以下内容:
,之后重新编译,问题就解决了。
切换回来对应新建时应用目录下的system.web.mvc.dll依然出现问题。
让view重新编译:
1,)修改web解决方案.csproj文件,
1.1,)设置MvcBuildViews属性为true;
<MvcBuildViews>true</MvcBuildViews>
1.2,)在</Project>前面加上以下内容:
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. <Target Name="BeforeBuild"> </Target> <Target Name="AfterBuild"> </Target> --> <Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'"> <AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" /> </Target> </Project>
,之后重新编译,问题就解决了。
相关文章推荐
- asp.net类序列化生成xml文件实例详解
- asp.net编程实现删除文件夹及文件夹下文件的方法
- asp.net基于session实现购物车的方法
- asp.net基于windows服务实现定时发送邮件的方法
- asp.net简单生成验证码的方法
- asp.net实现Gradview绑定数据库数据并导出Excel的方法
- ASP.NET WebAPI 12 Action的执行
- 转 asp.net中如何退出整个框架(frameset),回到登录界面
- ASP.NET Web API默认支持的媒体类型(SupportedMediaTypes)
- asp.net中的ListBox控件添加双击事件
- asp.net中的ListBox控件添加双击事件
- asp.net Global.asax 方法的使用和说明
- ASP.NET 中 ObsoleteAttribute 属性的使用
- asp.net 在线人数
- ASP.net(NVelocity)中浏览器端与服务器端频繁交互传值的问题
- Aspect Oriented Programming
- ASP.NET MVC 之 路由配置
- asp.net内置对象 Response对象使用介绍
- ASP图片格式与base64数据互转方法
- ASP.NET MVC 文件异步上传问题处理