I have an ASP.NET project under source control (Subversion). For various reasons, I don't want to add the \Bin directory or its contents to source control, so I have it svn:ignored. DLLs are loaded into here during a Visual Studio build, and I can start with a clean directory and/or delete all the contents of this directory and still have a successful build.
There are two ways that I reference code for inclusion in the project:
- In the Web.config element //configuration/configSections/system.web/compilation/assemblies. I can
<add>
any DLL that's in the GAC this way. I do this for all of the System dlls. - In the VS Solution, there's a setting at Project/ProjectSection/ProjectReferences that lets me specify included references to other projects in the solution.
(Note that this is different than non-web projects, where all references to external dependencies are stored in the project file. There's no project file for VS web projects so they have to be stored somewhere else.)
Now I have a 3rd-party compiled DLL that I'd like to include in the project. Unfortunately, none of the referencing options I've found seem to work for me:
- Referencing via web.config/system.web/compilation/assemblies doesn't work unless the DLL exists in the GAC; you can't use a file path. I'd really like to avoid a GAC dependency as it will mean an extra step to make the project work on every target machine.
- I haven't found a way to include a file reference in the solution like I can do with project references.
- Any time I add a file reference using VS's "Add Reference" dialog, it merely copies the DLL to the \Bin directory. That won't work for me as my \Bin directory isn't persistent across systems.
Is there another way I can make a reference to a DLL file and have it stick?