I've got a filesystem web project which references a few class projects. Those class projects reference more class projects which are, in the end, indirectly referenced by my web project.
I've created the web deployment project for my web project.
If I build from VS IDE both directly and indirectly referenced dlls are copied to my web project's bin folder. But, when I build the web deployment project from the command line (using msbuild), all of the directly referenced projects are built and their dlls
are copied to bin folder, but only some of the indirectly referenced project's dlls are copied to bin folder.
Does anyone have a clue why is this happening? How does WDP "decide" which dll's are going to be copied, and which aren't?
We're using WDP to make the integration build of the file system web project. Let's call that web project WebFS. The WebFS project references class library LibA which references class library LibB. There is a reference to LibA in the WDP's .wdproj file, but
there is no reference to LibB.
When I added the reference to LibA's project through the VS' IDE, VS copied LibA.dll and LibB.dll into WebFS' bin folder. Every time I build the solution, VS builds and copies LibA's outputs, which include LibB.dll, into bin folder.
On the other hand, WDP copies the existing content of the bin folder, builds project LibA, but copies only its primary output, LibA.dll. This implies a couple of problems:
When I build WebFS from the VS IDE, make a change to LibB.dll and build WDP project, I'll end up with the old version of LibB.dll in WebFS' bin folder.
When I build debug configuration of WebFS and then build release configuration of WDP, I'll end up with the release version of LibA.dll and debug version of LibB.dll
But, the biggest problem is that we use WDP to build WebFS on our build server. The server checks out the latest version of projects from source control and starts the build. We don't keep WebFS' bin folder in source control to avoid merge conflicts and because
all of its content can be built from referenced projects. Since WDP copies only the primary output of referenced projects the build ends up without LibB.dll
Could someone please confirm this behaviour? How should I configure my projects to build successfully on our build server?
If you reference LibA class library project from your WebFS project (see above), VS is going to copy everything from LibA's output folder to WebFS' bin folder whenever you build
LibA project! This obviously happens with a little help of the "magic" built into VS because this won't happen if you build the same solution file with msbuild from the command line.
If you use WDP project to build your WebFS project, WDP is going to copy everything what is inside WebFS' bin folder
and all appropriate references which it gets from ResolveAssemblyReference task. However, ResolveAssemblyReference won't find an assembly which is referenced by LibA's project but is never used inside LibA's code.
My problem is that I'm using LibB inside LibA's code only through reflection and, therefore, ResolveAssemblyReference doesn't detect it as referenced.
I solved it when I added a private class with a reference to a type from LibB. The LibB.dll "magically" appeared in WebFS' bin folder.
Patko74
Member
32 Points
7 Posts
How does WDP resolve references?
Jun 01, 2006 02:26 PM|LINK
I've created the web deployment project for my web project.
If I build from VS IDE both directly and indirectly referenced dlls are copied to my web project's bin folder. But, when I build the web deployment project from the command line (using msbuild), all of the directly referenced projects are built and their dlls are copied to bin folder, but only some of the indirectly referenced project's dlls are copied to bin folder.
Does anyone have a clue why is this happening? How does WDP "decide" which dll's are going to be copied, and which aren't?
Thanks
Hrvoje
Patko74
Member
32 Points
7 Posts
Re: How does WDP resolve references?
Jun 04, 2006 08:35 AM|LINK
We're using WDP to make the integration build of the file system web project. Let's call that web project WebFS. The WebFS project references class library LibA which references class library LibB. There is a reference to LibA in the WDP's .wdproj file, but there is no reference to LibB.
When I added the reference to LibA's project through the VS' IDE, VS copied LibA.dll and LibB.dll into WebFS' bin folder. Every time I build the solution, VS builds and copies LibA's outputs, which include LibB.dll, into bin folder.
On the other hand, WDP copies the existing content of the bin folder, builds project LibA, but copies only its primary output, LibA.dll. This implies a couple of problems:
- When I build WebFS from the VS IDE, make a change to LibB.dll and build WDP project, I'll end up with the old version of LibB.dll in WebFS' bin folder.
- When I build debug configuration of WebFS and then build release configuration of WDP, I'll end up with the release version of LibA.dll and debug version of LibB.dll
But, the biggest problem is that we use WDP to build WebFS on our build server. The server checks out the latest version of projects from source control and starts the build. We don't keep WebFS' bin folder in source control to avoid merge conflicts and because all of its content can be built from referenced projects. Since WDP copies only the primary output of referenced projects the build ends up without LibB.dllCould someone please confirm this behaviour? How should I configure my projects to build successfully on our build server?
Thanks
Hrvoje
Patko74
Member
32 Points
7 Posts
Re: How does WDP resolve references?
Jun 05, 2006 10:36 PM|LINK
If you reference LibA class library project from your WebFS project (see above), VS is going to copy everything from LibA's output folder to WebFS' bin folder whenever you build LibA project! This obviously happens with a little help of the "magic" built into VS because this won't happen if you build the same solution file with msbuild from the command line.
If you use WDP project to build your WebFS project, WDP is going to copy everything what is inside WebFS' bin folder and all appropriate references which it gets from ResolveAssemblyReference task. However, ResolveAssemblyReference won't find an assembly which is referenced by LibA's project but is never used inside LibA's code.
My problem is that I'm using LibB inside LibA's code only through reflection and, therefore, ResolveAssemblyReference doesn't detect it as referenced.
I solved it when I added a private class with a reference to a type from LibB. The LibB.dll "magically" appeared in WebFS' bin folder.
Hrvoje