Team Build 2008 with Web Application Projects does not copy deep references to "_PublishedWebsites" folder
-
Monday, December 20, 2010 10:49 AMWhen building (Team Build 2008) a solution that includes a Web Application Project, a "_PublishedWebsites" folder is created in the $(BinariesRoot) folder. Now the problem that comes up is that not all required references are copied to the bin folder(s) of the Web Application Projects in the "_PublishedWebsites" folder. The missing references are always references coming from a fixed file reference that's part of a project which is a project references in the Web Application Project ...
In detail the solution setup:- Project A is a C# Class Library Project which has a file reference to assembly X
- Project B is a web application project which has a project reference to Project A
When I build locally inside Visual Studio, assembly X is part of the bin folder of Project B --> OKWhen the solution is built with Team Build on the Build Server, assembly X is not copied to the bin folder of Project B in the "_PublishedWebsites" folder --> not OK
I already examined the Microsoft.WebApplication.targets file, but wasn't able to pinpoint the problem. Printing the @(ReferenceCopyLocalPaths) ItemGroup doesn't list assembly X which is why the assembly is not found in the build folder. I have no idea in which other targets file(s) this ItemGroup is set and which conditions are relevant.
Anyone experienced this behavior? Any decent solutions to fix this?
Best regards,
Pieter Gheysens.
Answers
-
Tuesday, December 28, 2010 9:34 AMModerator
Hello Pieter,
Sorry that it seems to be a limitation in MSBuild. Please take a look of this link. Although it refers to VS 2005, from my testing, it is still valid in VS 2010.
If you build the solution by msbuild locally, you will find that the secondary reference assembly doesn't copy to bin directory, neither. Even in VS, if you look into the msbuild diagnostic log file, you will find there is no entry indicating that VS is copying the referenced file to bin folder. VS copied the file out of the msbuild procedure.
The suggested way to fix the error is to reference all the secondary references in web application project.
Hope it helps.
Hongye Sun [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

- Proposed As Answer by Hongye SunModerator Wednesday, December 29, 2010 9:18 AM
- Marked As Answer by Cathy KongModerator Monday, January 03, 2011 2:41 AM
All Replies
-
Tuesday, December 21, 2010 7:55 AMModerator
Hi Pieter,
Thanks for posting the issue here!
Please refer to the following thread:
http://social.msdn.microsoft.com/Forums/en-US/tfsbuild/thread/62c7fec6-81b0-46a4-8fdc-0e31fdc0590f
For more information, you can refer to http://blogs.msdn.com/b/aaronhallberg/archive/2007/07/02/team-build-and-web-deployment-projects.aspx
Hope it helps!
Cathy Kong [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

-
Tuesday, December 21, 2010 9:42 AM
Hi Cathy,
The links you provided are not useful for fixing this bug/issue. I don't want an extra task that will manually copy the missing assemblies to the "_PublishedWebsites" folder from an explicit assembly list. I need some kind of tweak/hack that will resolve the dependencies of the involved projects automatically during the build. I don't want to investigate which assemblies will be missing time after time. This auto-resolving works locally when building the solution inside Visual Studio ...
Best regards,
Pieter.
-
Wednesday, December 22, 2010 3:17 AMModerator
Hi Pieter,
Sorry for not helping you!
I am currently looking into this issue and will give you an update as soon as possible.
Thank you for your understanding and support.
Cathy Kong [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

-
Tuesday, December 28, 2010 9:34 AMModerator
Hello Pieter,
Sorry that it seems to be a limitation in MSBuild. Please take a look of this link. Although it refers to VS 2005, from my testing, it is still valid in VS 2010.
If you build the solution by msbuild locally, you will find that the secondary reference assembly doesn't copy to bin directory, neither. Even in VS, if you look into the msbuild diagnostic log file, you will find there is no entry indicating that VS is copying the referenced file to bin folder. VS copied the file out of the msbuild procedure.
The suggested way to fix the error is to reference all the secondary references in web application project.
Hope it helps.
Hongye Sun [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

- Proposed As Answer by Hongye SunModerator Wednesday, December 29, 2010 9:18 AM
- Marked As Answer by Cathy KongModerator Monday, January 03, 2011 2:41 AM

