Developers using VS 2005 Web Site Projects can
add references to assemblies in multiple ways. When you right-click on a
project and choose the “Add Reference” menu option, it provides a dialog like
the one below that allows you to reference .NET assemblies registered in the
GAC, class libraries built as projects in the same VS solution, COM components,
and file-path based assemblies that you pick using the “Browse” tab of the “Add
References” dialog:
Figure 1
When you add a file-system based assembly
reference using the “Browse” dialog above, VS 2005 Web Sites will copy the
assembly picked into the \bin directory of the project as well as (by default)
add a .refresh file into the \bin directory that contains a relative path string
that points back to the original assembly path location:
Figure 2
When you build the solution, VS will
automatically check those assemblies with .refresh files to see if a newer
version of the assembly is available, and if so automatically re-copy the assembly
and re-compile the solution using it. This avoids you having to manually
update the assembly yourself every time it changes (it also avoids you having
to check-in the assembly under source control). If you don’t want this
“automatic refresh” capability, you can delete the .refresh file – in which
case VS will not check the timestamp nor update the assembly for you.
Because assemblies often have dependent
assembly references, Visual Studio will also automatically copy dependent
assemblies that a reference assembly requires into the \bin directory of the
target web-site as well. For example: if you setup a file-based reference
to ClassLibrary1.dll, which in turn uses an assembly called SharedLibrary.dll
that resides in the same directory, Visual Studio will make sure both
assemblies are copied into the Web Site’s \bin directory (note: if it didn’t do
this then the app would fail to run).