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

Notification

Icon
Error

Build error with JustMock (commercial)
ajw1970
#1 Posted : Monday, April 6, 2015 6:11:41 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/27/2014(UTC)
Posts: 3
Location: United States of America

Thanks: 1 times
I'm using NCrunch 2.14.0.8 and am getting an NCrunch build error on my project.

NCrunch: If you are experiencing problems in getting this project to build, have a look at http://www.ncrunch.net/d...ng_project-build-issues

OrderServiceTests.cs (5, 7): The type or namespace name 'Telerik' could not be found (are you missing a using directive or an assembly reference?)

WARNING - ..\..\..\..\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets (1697, 5): Could not resolve this reference. Could not locate the assembly "Telerik.JustMock". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

My JustMock version is 2015.1.224.3

I'm using VS 2013

I'm running on Win 8.1 pro 64 bit.

Any suggestions?
Remco
#2 Posted : Monday, April 6, 2015 10:31:32 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,984

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi, thanks for posting.

Are you able to check where the Telerik.JustMock is normally referenced within your VS build? Is it perhaps being hooked up through a Nuget package of some sort? I'm wondering if it's possible that NCrunch has somehow been unable to detect the dependency when it needs to be copied to the workspace.
ajw1970
#3 Posted : Monday, April 6, 2015 11:07:51 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/27/2014(UTC)
Posts: 3
Location: United States of America

Thanks: 1 times
Hello, thanks for the reply. I'm not using nugget. The dll is just a reference added with browsing to the installation library folder:

C:\Program Files (x86)\Telerik\JustMock\Libraries\Telerik.JustMock.dll

I just created a new test project with the Telerik template and NCrunch is working with that one. I'll have to do more digging into the project that isn't working.
Remco
#4 Posted : Monday, April 6, 2015 11:13:49 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,984

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Try setting your 'Log Verbosity' (global NCrunch setting) to 'Detailed', then examine the build log against the Build Task inside the NCrunch Processing Queue.

This may give you some useful information about where the build system is looking for assembly references.

NCrunch won't try to copy DLLs from Program Files into its workspace - it will just reference them directly. If you can compare a build log from NCrunch with a build log from MSBuild, this may give you some useful clues about how the referencing logic for this assembly is behaving differently. To obtain a detailed build log from MSBuild, just open a command prompt to the directory containing the project, then type:

msbuild /v:d > BuildLog.txt

You may also need to set the path to MSBuild. Usually this will be under C:\Program Files (x86)\MSBuild\12.0\Bin
ajw1970
#5 Posted : Monday, April 6, 2015 11:59:20 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/27/2014(UTC)
Posts: 3
Location: United States of America

Thanks: 1 times
I looked at the differences between the working and non-working projects and found the following in the csproj file:

Non-working:
<Reference Include="Telerik.JustMock">
<HintPath>..\..\..\..\Program Files (x86)\Telerik\JustMock\Libraries\Telerik.JustMock.dll</HintPath>
</Reference>

Working:
<Reference Include="Telerik.JustMock">
<HintPath>$(registry:HKEY_LOCAL_MACHINE\Software\Telerik\JustMock@BinaryPath)Telerik.JustMock.dll</HintPath>
</Reference>

It looks like the Telerik template uses the registry lookup which works. I changed this in the bad project and now it works fine.
Remco
#6 Posted : Tuesday, April 7, 2015 12:02:31 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,984

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Excellent, thanks! I can understand how this is happening. I'll see if there's anything I can do about it from the NCrunch side. I appreciate you sharing the solution as I'm sure that others will also find it helpful.
1 user thanked Remco for this useful post.
ajw1970 on 4/7/2015(UTC)
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.039 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download