asp.net mvc4 设置build项目时,编译view页面
2021腾讯云限时秒杀,爆款1核2G云服务器298元/3年!(领取2860元代金券),
地址:https://cloud.tencent.com/act/cps/redirect?redirect=1062
2021阿里云最低价产品入口+领取代金券(老用户3折起),
入口地址:https://www.aliyun.com/minisite/goods
最近做项目是遇到一个问题,在我们的view中经常遇到一些匿名类型对象,然后在通过RenderPartial输出这些对象。 还是举个例子吧,有3个view Index.cshtml、Test.c
新建好项目后,把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重新编译:
推荐:ASP.NET MVC的Razor引擎:View编译原理
up vote 1 down vote favorite I'm trying to create a custom cartridge application on OpenShift using the command rhc -d create-app liferay htt..... An
1,)修改web解决方案.csproj文件,
1.1,)设置MvcBuildViews属性为true;
<MvcBuildViews>true</MvcBuildViews>
1.2,)在</Project>前面加上以下内容:
1 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 2 Other similar extension points exist, see Microsoft.Common.targets. 3 <Target Name="BeforeBuild"> 4 </Target> 5 <Target Name="AfterBuild"> 6 </Target> --> 7 <Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'"> 8 <AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" /> 9 </Target> 10 </Project>
,之后重新编译,问题就解决了。
我们公司的项目是用asp.net mvc Razor开发的,先看看带代码吧: var itemRef = "P43_1"; try { var expermentCode = "PLE0043"; itemRef
相关阅读排行
- 1asp.net发布到IIS中出现错误:处理程序“PageHandlerFactory-Integrated”在其模块列表中有一个错误模块“ManagedPipelineHandler”
- 2[Asp.Net MVC4]验证用户登录实现
- 3检测到在集成的托管管道模式下不适用的ASP.NET设置的解决方法(非简单设置为【经典】模式)。 - CatcherX
- 4asp.net CheckBoxList 取值与勾选,复选框后台控制前台checkbox选中
- 5ASP.NET 3.5 企业级开发