Is is possible to compile asp.net mvc views into one assemply when publishing web project?
            Asked
            
        
        
            Active
            
        
            Viewed 2,162 times
        
    1 Answers
2
            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.
 
    
    
        eu-ge-ne
        
- 28,023
- 6
- 71
- 62
- 
                    i used web deployment projects but it wasn't working as it supposed to – T W Jun 06 '09 at 18:51
- 
                    You could try aspnet_merge.exe -o OutputAssemblyName.dll "path to your compiled project". It works well on my projects – eu-ge-ne Jun 06 '09 at 19:21
