user3231442
user3231442

Reputation: 620

how to resolve conflict with path on tfs

I have Unit test. On csproj file the path write this way:

<Reference Include="DocumentFormat.OpenXml, Version=2.5.5631.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>..\..\Dependency\DocumentFormat.OpenXml.dll</HintPath>
</Reference>

But when I build project on tfs, After compile I see warning:

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

Because this path (....\Dependency\DocumentFormat.OpenXml.dll) doesn't exist. The current directory is /bin. So how can I resolve this warning?

Upvotes: 0

Views: 1644

Answers (3)

RTPeat
RTPeat

Reputation: 650

We encountered this problem having added DocumentFormat.OpenXml.dll via the Nuget package. Going through the references that the package had created we found that rather than referencing the installed dll, it was instead referencing a copy in C:\Program Files (x86)\Open XML SDK\V2.5.

After initially adding a copy of the DLL to the solution directly and changing the references to get it building on TFS, we tried just manually reinstalling the package from the Package Manager Console using Update-Package -reinstall DocumentFormat.OpenXml which recreated the references with the correct path to the copy in the packages folder and the error did not occur.

Upvotes: 1

Martin Costello
Martin Costello

Reputation: 10843

Looks like the ..\..\Dependency\DocumentFormat.OpenXml.dll file isn't checked-in to TFS. Check it in in an appropriate location in the solution and update the reference in the .csproj file.

Upvotes: 1

Over Killer
Over Killer

Reputation: 513

Copy library *.dll to place where is project executable.

Upvotes: 0

Related Questions