How do I compile an ASP.NET website into a single DLL file?

安稳与你 提交于 2019-11-28 18:52:06

You might prefer to use the web application project style for that.

You can use ILMerge to merge assemblies into one.

The way we do it is by adding a deployment project to our site:

http://msdn.microsoft.com/en-us/asp.net/aa336619.aspx

Mitchel Sellers

To accomplish this you will have to covert your project into a Web Application Project (Supported in Visual Studio 2005 SP1 and Visual Studio 2008).

The process of converting is not that hard, but you will need to move everything out of the app_code folder, as WAP (Web Application Projects) projects do not have code inside app_code.

Once you do this, everything inside your project is compiled into a single DLL file, any external assemblies are still contained in their own DLL files though, but there are options around that as well.

We use build scripts for our websites and run the aspnet_merge.exe from the command line. Here's the MSDN page: http://msdn.microsoft.com/en-us/library/bb397866.aspx

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