views:

210

answers:

4

The title pretty much says it all.

Given a web site project in VS2008 named FooDLL, I would like to be able to specify the name of the assembly that VS2008 spits out when I click "Publish Web Site". I am using the "use fixed naming and single page assemblies" option, so the resulting DLL is consistently named.

However, I would much rather be able to specify that the DLL is named something like FooDLL.dll (or just Foo.dll, whatever) than be stuck with the ugliness of App_Web_foo.ascx.cdcab7d2.dll.

Am I stuck since Web Sites don't have .project files (e.g. aren't projects)?

A: 

You could just compile your code as a class library project, then drop it into the Bin directory of your website.

Neil N
I already tried doing that. After way too many days of pulling my hair out, I arrived at the conclusion that I have to use a web site for this since I'm writing a user control (and delivering it as a single assembly).
Matt Ball
A: 

I believe you are.

I am unaware of any benefits to using a web site project and while the benefits of using a web application project are minor, they exist. Create web application projects from now on.

Spencer Ruport
See my comment @Neil above.
Matt Ball
You can have user controls in a web application and it will build a single assembly.
Spencer Ruport
I spent the last month or so going back and forth on this very thing. I don't want to provide the control as a user control (where the register directive uses the src tag), I want to provide it as a DLL (where the register directive uses the assembly tag).http://stackoverflow.com/questions/1161420/how-do-i-build-a-user-control-into-a-self-contained-assembly-in-vs2008
Matt Ball
To do that, you need to create a web server control.
Spencer Ruport
Inside of what kind of project? A web application project? The documentation on this kind of basic "which direction do I head off in" is really lacking.
Matt Ball
Yes you can create them inside web application projects though there doesn't seem to be a template for them. But it's just a class like any other and you can find examples of them throughout the web.
Spencer Ruport
A: 

ASP.NET Merge Tool (Aspnet_merge.exe) is your way to go. It merge your web assemblies into one assembly for the whole Web site.

more information: http://msdn.microsoft.com/en-us/library/bb397866.aspx

Anwar Chandra
+1  A: 

Not to continue the pattern of answering my own questions, but here it is anyway:

All I had to do was add a Web Deployment Project for the web site containing my user control. Though you can't specify the assembly name when building/publishing a web site, you can do this through the web deployment project. It's basically just a nice GUI for an msbuild project file... for a web site. Hooray for hacking a .project file onto a web site!

Matt Ball
There's quite a few other things you can do with web deployment projects too, such as removing all files of a given type, or substituting one web.config for another depending on your solution configuration (debug, release etc).
Paul Suart