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/documentation/troubleshooting_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 NCrunch Developer
#7179
06 Apr 2015 22:31 UTC
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.
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.
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.
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 NCrunch Developer
#7181
06 Apr 2015 23:13 UTC
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
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
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.
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 NCrunch Developer
#7183
07 Apr 2015 00:02 UTC
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.
Post a reply
Log in to reply.