Compiling views when publishing asp.net mvc project

人走茶凉 提交于 2019-12-06 04:30:58

问题


Is is possible to compile asp.net mvc views into one assemply when publishing web project?


回答1:


There is ASP.NET Merge tool (Aspnet_merge.exe) and Web Deployment Projects ( UPDATED: Aspnet_merge.exe came with Windows SDK components when you installing Visual Studio 2008 - look at "%Program Files%\Microsoft SDKs\Windows\v6.0A\bin" folder ). These links may be interesting to you:

  • How Do I: Use MSBuild to Automate the ASP.NET Compiler and Merge Utilities
  • Managing ASP.NET Precompiled Output for Deployment Using the aspnet_merge.exe Command

UPDATED:

In ASP.NET MVC projects there is <MvcBuildViews>true/false</MvcBuildViews> property which enables compiling Views in AfterBuild target. But it does not compile your project in one assembly. You should use ASP.NET Merge tool or Web Deployment Projects.



来源:https://stackoverflow.com/questions/959859/compiling-views-when-publishing-asp-net-mvc-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!