Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS build failing. Unresolved references to files that are in source control

I have a build that works fine locally, however, will not build within our TFS environment.

I get the following error;

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (1578): Could not resolve this reference. Could not locate the assembly "Assembly.Services.Common". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

The assembly in question is checked into TFS and is in the following location;

/Root/BaseBinRefs/Assembly.Services.Common.dll

It does not have any external references outside of the .net framework.

The project that is failing to build is in the following location in TFS

/Root/Services/AssemblySolutionFolder/AssemblyThatIsFailing

The assembly is referenced in a project within the solution and the HintPath to the assembly appear to be correct;

   <Reference Include="Assembly.Services.Common, Version=1.0.0.0, 
      Culture=neutral, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\..\BaseBinRefs\Assembly.Services.Common.dll</HintPath>
    </Reference>

As said, it builds locally and I can see no reason why it should fail within TFS. the caveat to that is that I am new to TFS in general and still trying to integrate the first of our projects into this environment.

Update 1

Using ProcessMonitor, I see TFS attempting to load the file from;

C:\Builds\1\Root\BaseBinRefs\Assembly.Services.Common.dll

Which does not exist, but is correct in the relative sense. Now, when I look in the Sources directory, I see BaseBinRefs, with Assembly.Services.Common.dll included, so it has downloaded them (I added the BaseBinRefs to the build definition)

like image 213
ChrisBint Avatar asked Aug 24 '12 02:08

ChrisBint


1 Answers

This could be an issue on how the working folders are set up in your build definition (under Workspace).

If I understood your path-scheme correctly, setting the paths as follows should work:

Active |$/TeamProject/Root/BaseBinRefs/                    |$(SourceDir)\Root\BaseBinRefs
Active |$/TeamProject/Root/Services/AssemblySolutionFolder/|$(SourceDir)\Root\Services\AssemblySolutionFolder

whereas, for example, this would cause trouble:

Active |$/TeamProject/Root/BaseBinRefs/                    |$(SourceDir)\
Active |$/TeamProject/Root/Services/AssemblySolutionFolder/|$(SourceDir)\
like image 183
pantelif Avatar answered Nov 15 '22 17:11

pantelif