Fervent Coder

Coding Towards Utopia...by Rob Reynolds
posts - 278 , comments - 431 , trackbacks - 0

My Links

News


Rob Reynolds

Subscribe to Fervent Coder RSS
Subscribe to Fervent Coder by Email

About Me

I manage several open source projects. Need...
   ...package management for Windows?
   ...automated builds?
   ...database change management (migrations)?
   ...your application to check email?
   ...a monitoring utility?

I also write for



Like what you are reading? Want to buy me a cup of coffee?
PayPal - The safer, easier way to pay online!

Article Categories

Archives

Post Categories

Sites

TFS 2005 Team Build Error: Referenced Assembly Missing (Not In Build Folder)

You may run into this at some point. TFS Team Build may not deploy some assembly file you needed.  If you look through the logs, you will see something like this (cleaned up for readability):

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Vbc.exe
/noconfig
/optionstrict+
/rootnamespace:Company.Project.Console
/doc:obj\Release\Company.Project.Console.xml
/define:"CONFIG=\"Release\",TRACE=-1,_MyType=\"Console\",PLATFORM=\"AnyCPU\""
/reference:..\libs\Castle\Castle.Core.dll,
..\libs\Castle\Castle.DynamicProxy2.dll,
..\libs\Castle\Castle.Facilities.NHibernateIntegration.dll,
..\libs\Castle\Castle.MicroKernel.dll,
..\libs\Castle\Castle.Windsor.dll,
c:\BuildLocation\Company.Project\Project_Candidate\Binaries\Release\Company.Project.dll,
c:\BuildLocation\Company.Project\Project_Candidate\Binaries\Release\Company.Shared.dll,
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727System.Data.dll,
C:\WINDOWS\Microsoft.NET\Framework\v2.0.5072\System.Deployment.dll,
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727System.dll,
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll
/main:Company.Project.Console.Program
/debug:pdbonly /optimize+
/out:obj\Release\Company.Project.Console.exe
/target:exe Program.vb "My Project\AssemblyInfo.vb"
/warnaserror+:41999,42016,42017,42018,42019,42020,42021,42022,42024,42025,42029,42030,42031,42032,42036,42104,42105,42106,42107,42108,42109

Target _CopyFilesMarkedCopyLocal:
    Copying file from "..\libs\Castle\Castle.Core.dll" to "c:\BuildLocation\Company.Project\Project_Candidate\Binaries\Release\Castle.Core.dll".
    Copying file from "..\libs\Castle\Castle.DynamicProxy2.dll" to "c:\BuildLocation\Company.Project\Project_Candidate\Binaries\Release\Castle.DynamicProxy2.dll".
(MY NOTE: This is missing a "Copying file" for Castle.Facilities.NHibernateIntegration.dll)
    Copying file from "..\libs\Castle\Castle.MicroKernel.dll" to "c:\BuildLocation\Company.Project\Project_Candidate\Binaries\Release\Castle.MicroKernel.dll".
    Copying file from "..\libs\Castle\Castle.Windsor.dll" to "c:\BuildLocation\Company.Project\Project_Candidate\Binaries\Release\Castle.Windsor.dll".

What the heck?  I know I have this file marked as copy local. It copies it when I build locally. That is the default setting when adding a reference to have it copied local. What's the deal?

Who knows why it does this (or doesn't in this case), but if this ever happens to you, it is a simple fix. Some simple switch may not be being picked up or you need to get an explicit switch into the solution.

The Fix

1. In Visual Studio, go to Solution Explorer on the project that is having the issues with the referenced assembly.

2. Open your References folder and find the item that is not making it into the build folder during a team build (we are going to pretend that is log4net here). NOTE: In Visual Basic to see the References folder in Solution Explorer, you need to select View All Files after selecting any item in the project in Solution Explorer.

image

image

3. Right click and select [Properties]. Find [Copy Local].

image

4. Change [Copy Local] to False.

image

5. Change [Copy Local] back to True.

image

6. Check into source control any changes that have occurred.

7. Try your team build again.

8. That's it.

Print | posted on Tuesday, August 19, 2008 7:21 PM | Filed Under [ Code ]

Feedback

Gravatar

# re: TFS 2005 Team Build Error: Referenced Assembly Missing (Not In Build Folder)

You are right: At first the <Private> element within the project file is missing. If you follow step 1-8 the private element for the Reference is added and is set to True. It's a bug.
Thanks for your description.
9/3/2008 2:45 AM | Janny
Gravatar

# re: TFS 2005 Team Build Error: Referenced Assembly Missing (Not In Build Folder)

Hi,is there any way that I can set it in Team Build build script TFSBuild.proj. file to make that referenced assembly copy local properties into true.

Thanks
4/12/2009 11:01 PM | Caled
Gravatar

# re: TFS 2005 Team Build Error: Referenced Assembly Missing (Not In Build Folder)

Hi,is there anyway that I can set it in the build script .proj file to set the referenced assembly copy local to true?
4/12/2009 11:04 PM | Caled
Gravatar

# re: TFS 2005 Team Build Error: Referenced Assembly Missing (Not In Build Folder)

@Caled: Just set it in the actual project that way. That way Visual Studio will be right.

This is a bug in Visual Studio itself.
4/14/2009 7:43 PM | Robz
Gravatar

# re: TFS 2005 Team Build Error: Referenced Assembly Missing (Not In Build Folder)

Thanks!
You saved my day.
We've migrated from VB6 to VB.NET and are moving forward to a full C# implementation. I can't wait to get rid of the residual VB.NET code... Ahhrg...
/Peter
12/7/2009 8:41 AM | Peter Rundqvist
Comments have been closed on this topic.

Powered by: