Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Assemblies are being referenced from the build output directory of other projects in this solution
sferencik
#1 Posted : Wednesday, July 17, 2013 12:25:24 PM(UTC)
Rank: Member

Groups: Registered
Joined: 4/4/2013(UTC)
Posts: 16
Location: Czech Republic

Thanks: 4 times
Was thanked: 1 time(s) in 1 post(s)
I've upgraded from RhinoMocks 3.0.1 to RhinoMocks 3.6.0 and started getting this warning:

Quote:
QattHarnessTests: Assemblies are being referenced from the build output directory of other projects in this solution
...
The following assembly references have triggered this warning:
C:\p4_ws\ferencis_tt\dev\test\HarnessTests\bin\x86\Debug\Rhino.Mocks.dll


I have read Remco's explanation of this in another forum post. As proposed in that post, I have built the project from the command-line:
Quote:
C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe .\QattHarnessTests.csproj /v:d


but nothing in the output of that build gives me a hint of what's wrong.

The project is QattHarnessTests.csproj and the HintPath for RhinoMocks is correct, i.e. it is an absolute path pointing outside of any build-output directory. (c:\p4_ws\ThirdParty\vc8-win32\RhinoMocks-3.6.0\Rhino.Mocks.dll). Does the warning message mean that QattHarnessTests is ignoring the HintPath and instead referencing RhinoMocks from the build-output directory (C:\p4_ws\ferencis_tt\dev\test\HarnessTests\bin\x86\Debug\Rhino.Mocks.dll)? I can't see anything in the output of MSBuild that suggests this.

I can share the output of MSBuild; what's the best way to share an 800k file here?

Thanks,
Sam
Remco
#2 Posted : Wednesday, July 17, 2013 1:22:41 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi Sam,

MSBuild is a strange beast. If you are seeing this warning, then MSBuild is resolving the reference from the wrong path. This is a common problem when upgrading referenced assemblies that are still being referenced by projects in your solution under their previous version. For example, you may have a project in your solution that is referencing v3.0.1 of RhinoMocks (even though the hint path may point to 3.6.0). MSBuild will follow any number of implicit paths to find the assembly it wants - and in this case is finding it in the build output directory of one of the other projects in your solution.

The best way to resolve this problem is to clean your solution out entirely. Delete all build outputs from all projects, then rebuild your solution from scratch. If all is well, you should start to see build errors appear that alert you to the true problem here. MSBuild is masking a resolution issue with implicit logic.

Generally with the /v:d switch, MSBuild will output referencing information for each assembly reference it resolves during the build process, i.e:

Primary reference "nunit.framework, Version=2.6.1.12217, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77".
Resolved file path is "C:\Temp\nunit.framework.dll".
Reference found at search path location "{HintPathFromItem}".
The ImageRuntimeVersion for this reference is "v2.0.50727".

Because the output is large, you'll probably need to dump it to file to see the entire thing (i.e. msbuild /v:d > output.txt)

But in all honesty, troubleshooting the issue with MSBuild output is probably the hard way to solve this problem. The easiest way is to simply remove ALL possible chances for MSBuild to execute the implicit logic (i.e. by clearing out all offending assemblies), then observing the hard facts in the error output.
1 user thanked Remco for this useful post.
sferencik on 7/17/2013(UTC)
sferencik
#3 Posted : Wednesday, July 17, 2013 1:35:09 PM(UTC)
Rank: Member

Groups: Registered
Joined: 4/4/2013(UTC)
Posts: 16
Location: Czech Republic

Thanks: 4 times
Was thanked: 1 time(s) in 1 post(s)
I do have it in a file (the 800k one I mentioned) but it seems to be doing the right thing:

Primary reference "Rhino.Mocks, Version=3.6.0.0, Culture=neutral, PublicKeyToken=0b3305902db7183f".
Resolved file path is "c:\p4_ws\ThirdParty\vc8-win32\RhinoMocks-3.6.0\Rhino.Mocks.dll".
Reference found at search path location "{HintPathFromItem}".
Found related file "c:\p4_ws\ThirdParty\vc8-win32\RhinoMocks-3.6.0\Rhino.Mocks.xml".

Anyway, will clean the build output and see where I get. Thanks.
sferencik
#4 Posted : Wednesday, July 17, 2013 3:57:17 PM(UTC)
Rank: Member

Groups: Registered
Joined: 4/4/2013(UTC)
Posts: 16
Location: Czech Republic

Thanks: 4 times
Was thanked: 1 time(s) in 1 post(s)
Remco,

Yes, it worked; thanks.

This is probably the best-supported third-party product I've ever worked with. (That includes the forum, the email comms, and the online documentation.)

Thanks,
Sam
Remco
#5 Posted : Wednesday, July 17, 2013 10:18:34 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Thanks Sam! Great to hear and I'm glad you're enjoying the product!


Cheers,

Remco
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.047 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download