all groups > visual studio .net general > november 2007 >
You're in the

visual studio .net general

group:

Automated build of a solution with web projects and changing dependencies


Automated build of a solution with web projects and changing dependencies m00lie NO[at]SPAM hotmail.com
11/1/2007 8:48:26 AM
visual studio .net general:
Hi all,

I have the following issue with automated builds using Visual
Studio .NET 2003.

I have a solution containing multiple web projects, class library
projects and a windows application project.
Several projects have a reference to a library that is found on a
network drive (lets say: G:\MyLibrary\).

There are multiple versions of the library available. The directory
structure of G:\MyLibrary\ is something like:
G:\MyLibrary\VersionA\MyLibrary.dll
G:\MyLibrary\VersionB\MyLibrary.dll
G:\MyLibrary\VersionC\MyLibrary.dll
G:\MyLibrary\VersionD\MyLibrary.dll

Please note that this library is not in the Global Assembly Cache.

First, I want this solution to build with version B of the library, so
using the Visual Studio IDE, I add the correct references to the
library to the projects. This creates project files (.csproj)
containing a 'hint path' to G:\MyLibrary\VersionB\MyLibrary.dll and
project user files (.csproj.user) containing a 'references path' to G:
\MyLibrary\VersionB\. Please note that web projects do not generate
project user files.

Another machine that is used for automated daily builds fetches the
solution from source control and builds it (using VS.NET 2003). This
machine (the 'build machine') also has access to network drive G.
Assuming this is the first time the project is build on the build
machine, there will be no cached versions of MyLibrary.dll on the
build machine and the build will succeed (it finds the correct version
(B) of the library because of the 'hint path'.) .csproj.user files
will also be generated on the build machine with 'references path' = G:
\MyLibrary\VersionB\.

Then I make some changes to my solution and I want the whole solution
to build with version C of the library. So once again, I add the
proper references to the projects and commit the changes to source
control.
The build machine will fetch the changes from source control, but the
build will fail because the references path in the .csproj.user file
takes precedence over the hint path in the .csproj file and the
references path still points to version B.

Is there any solution to this problem? I tried adding the .csproj.user
files to source control, though I didn't like it, but this didn't work
either because the web projects would still fail: they don't have
a .csproj.user file and seemed to build with a cached version of
MyLibrary.dll, like version A or B.

The whole idea of automated builds seems impossible when there are web
projects in your solution and you reference a library that gets
updated periodically. It drives me crazy. Of course it is possible to
create a pre-build step that clears the vswebcache directory (and
other places?), but that is not a nice solution I think.
AddThis Social Bookmark Button