views:

10286

answers:

5

I have finally finished my web site. I published it and I was surprised at the results. Although the App_Code compiled into a single .dll, every pages code behind compiled into it's own .dll. How do i make it so that it is one .dll?

Also, is it possible to compile everything (SubSonic,AJAX,etc) into that same single .dll?

+13  A: 

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

You can use ILMerge to merge assemblies into one.

Cristian Libardo
I agree - a web app is the way to go. Convert your project to a web app.
Guy
+1  A: 

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

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

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

Mitchel Sellers
+4  A: 

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

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

John
+1  A: 

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

mmacaulay
A: 

I have a need for the opposite. We have a website not app, but still generate a single DLL of the app. We are in a security-regidand multi-developer environment, so we prefer to just release file over a DLL.

We've removed the .csproj, restart IIS, still code-behind is not taking place unless we copy over the DLL.

Back on our development local boxes, all have this option when r-click on the project/solution: Convert to Web Application.

Any clue???

You should post this as a new question, not as an answer to an old question. In the upper right there is a "Ask Question" button that allows you to ask a new question.
sth