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

Notification

Icon
Error

Build Error with JustMock
jmarbutt
#1 Posted : Thursday, April 17, 2014 1:54:58 AM(UTC)
Rank: Member

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

Was thanked: 1 time(s) in 1 post(s)
I am getting the following error message:

The type or namespace name 'Telerik' could not be found (are you missing a using directive or an assembly reference?)

I added Just Mock to my testing project and I followed the configuration instructions at http://www.telerik.com/h...ntegration-ncrunch.html

All I did was add the Proxy file path to on my test project in the ncrunch configuration : C:\Program Files (x86)\Telerik\JustMock\Libraries\JustMockRunner.exe

Did I miss something?
Remco
#2 Posted : Thursday, April 17, 2014 2:16:20 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 929 times
Was thanked: 1256 time(s) in 1169 post(s)
Hi,

Thanks for sharing this issue.

This looks very much like an assembly reference build error. Does the project build correctly? If not, I don't think this error is related to the instructions on the JustMock page, or the JustMock profiler itself. Can you give me more context around this error? Does it appear against a project in the Tests Window? Or perhaps against a specific test?

Does this project build correctly using Visual Studio?

Can you show me the XML used in the .proj file to reference the Telerik JustMock library?

If you haven't already, it's worth placing NCrunch into compatibility mode. This will create a closer alignment with the Visual Studio build and may help to narrow down the problem.
jmarbutt
#3 Posted : Thursday, April 17, 2014 2:21:13 AM(UTC)
Rank: Member

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

Was thanked: 1 time(s) in 1 post(s)
It does build correctly in Visual Studio.

Here is the XML for the reference:

<Reference Include="Telerik.JustMock, Version=2014.1.1519.1, Culture=neutral, PublicKeyToken=721b6c5bc0326b3a, processorArchitecture=MSIL">
<HintPath>..\..\..\..\Program Files (x86)\Telerik\JustMock\Libraries\Telerik.JustMock.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<Private>True</Private>
</Reference>
jmarbutt
#4 Posted : Thursday, April 17, 2014 2:23:49 AM(UTC)
Rank: Member

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

Was thanked: 1 time(s) in 1 post(s)
Setting it in compatibility mode does not work either.
Remco
#5 Posted : Thursday, April 17, 2014 2:24:41 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 929 times
Was thanked: 1256 time(s) in 1169 post(s)
Can you confirm where you see the error? This is important as I need to know whether the error is appearing at build time or somewhere else.
jmarbutt
#6 Posted : Thursday, April 17, 2014 2:27:20 AM(UTC)
Rank: Member

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

Was thanked: 1 time(s) in 1 post(s)
I see it in the nCrunch processing queue

[21:25:19.8981-LocalBuildTask-54] ERROR (Build): MyProject.Tests: C:\Users\jonathan\AppData\Local\NCrunch\3280\31\MyProject.Tests\Repositories\RepositoryTest.cs (6): The type or namespace name 'Telerik' could not be found (are you missing a using directive or an assembly reference?)

[21:25:19.8981-LocalBuildTask-54] ERROR (Build): MyProject.Tests: C:\Users\jonathan\AppData\Local\NCrunch\3280\31\MyProject.Tests\Repositories\RepositoryTest.cs (7): The type or namespace name 'Telerik' could not be found (are you missing a using directive or an assembly reference?)

Remco
#7 Posted : Thursday, April 17, 2014 2:32:59 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 929 times
Was thanked: 1256 time(s) in 1169 post(s)
Ok - I think we'll need to get a capture of the build output for this project.

Under your global configuration settings, set the 'Log verbosity' setting to 'Detailed', then reset the engine and find the failed build task in the queue. The output text should contain a wealth of MSBuild information, and most likely there will be something in there detailing why the reference couldn't be resolved. Do you see anything about the reference? You can also copy/paste the build output here if you like, and I can take a look for you.
jmarbutt
#8 Posted : Thursday, April 17, 2014 2:38:28 AM(UTC)
Rank: Member

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

Was thanked: 1 time(s) in 1 post(s)
Primary reference "Telerik.JustMock".
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.
For SearchPath "{HintPathFromItem}".
Considered "..\..\..\..\Program Files (x86)\Telerik\JustMock\Libraries\Telerik.JustMock.dll", but it didn't exist.
For SearchPath "{TargetFrameworkDirectory}".
Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Telerik.JustMock.winmd", but it didn't exist.
Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Telerik.JustMock.dll", but it didn't exist.
Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Telerik.JustMock.exe", but it didn't exist.
Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Facades\Telerik.JustMock.winmd", but it didn't exist.
Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Facades\Telerik.JustMock.dll", but it didn't exist.
Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Facades\Telerik.JustMock.exe", but it didn't exist.
For SearchPath "{Registry:Software\Microsoft\.NETFramework,v4.5,AssemblyFoldersEx}".
Considered AssemblyFoldersEx locations.
For SearchPath "{AssemblyFolders}".
Considered "C:\Program Files (x86)\Telerik\Reporting Q1 2014\Bin\Telerik.JustMock.winmd", but it didn't exist.
Considered "C:\Program Files (x86)\Telerik\Reporting Q1 2014\Bin\Telerik.JustMock.dll", but it didn't exist.
Considered "C:\Program Files (x86)\Telerik\Reporting Q1 2014\Bin\Telerik.JustMock.exe", but it didn't exist.
Considered "C:\Program Files (x86)\Microsoft SQL Server\120\SDK\Assemblies\Telerik.JustMock.winmd", but it didn't exist.
Considered "C:\Program Files (x86)\Microsoft SQL Server\120\SDK\Assemblies\Telerik.JustMock.dll", but it didn't exist.
Considered "C:\Program Files (x86)\Microsoft SQL Server\120\SDK\Assemblies\Telerik.JustMock.exe", but it didn't exist.
Considered "C:\Program Files\IIS\Microsoft Web Deploy V3\Telerik.JustMock.winmd", but it didn't exist.
Considered "C:\Program Files\IIS\Microsoft Web Deploy V3\Telerik.JustMock.dll", but it didn't exist.
Considered "C:\Program Files\IIS\Microsoft Web Deploy V3\Telerik.JustMock.exe", but it didn't exist.
Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\Telerik.JustMock.winmd", but it didn't exist.
Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\Telerik.JustMock.dll", but it didn't exist.
Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\Telerik.JustMock.exe", but it didn't exist.
Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0\Telerik.JustMock.winmd", but it didn't exist.
Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0\Telerik.JustMock.dll", but it didn't exist.
Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0\Telerik.JustMock.exe", but it didn't exist.
Considered "C:\Program Files (x86)\Microsoft.NET\ADOMD.NET\110\Telerik.JustMock.winmd", but it didn't exist.
Considered "C:\Program Files (x86)\Microsoft.NET\ADOMD.NET\110\Telerik.JustMock.dll", but it didn't exist.
Considered "C:\Program Files (x86)\Microsoft.NET\ADOMD.NET\110\Telerik.JustMock.exe", but it didn't exist.
For SearchPath "{GAC}".
Considered "Telerik.JustMock", which was not found in the GAC.
For SearchPath "{RawFileName}".
Considered treating "Telerik.JustMock, Version=2014.1.1519.1, Culture=neutral, PublicKeyToken=721b6c5bc0326b3a, processorArchitecture=MSIL" as a file name, but it didn't exist.
For SearchPath "bin\Debug\".
Considered "bin\Debug\Telerik.JustMock.winmd", but it didn't exist.
Considered "bin\Debug\Telerik.JustMock.dll", but it didn't exist.
Considered "bin\Debug\Telerik.JustMock.exe", but it didn't exist.
Remco
#9 Posted : Thursday, April 17, 2014 2:49:31 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 929 times
Was thanked: 1256 time(s) in 1169 post(s)
It looks like NCrunch's translation for this reference seems to be failing. I'm not sure why this is the case - hopefully there isn't some kind of override being put in place by JustMock. I'm wondering if you could check the following:

- If you right-click on the failed build in the Tests Window, then choose Advanced->Browse to workspace, then open up the generated .proj file inside this workspace, what does the reference to the JustMock DLL look like? Can you copy/paste the XML?
- Looking around inside this workspace, look for a directory called _ncrunchreferences - it will be near the root of the workspace. Does the Telerik DLL exist inside this directory?
- Does removing the <Private>true</Private> declaration inside the reference in your foreground solution have any effect on the problem?
- Can you submit an NCrunch bug report after the build has failed?


Thanks!

Remco
jmarbutt
#10 Posted : Thursday, April 17, 2014 2:58:09 AM(UTC)
Rank: Member

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

Was thanked: 1 time(s) in 1 post(s)
Here is the reference from the workspace project file:
<Reference Include="Telerik.JustMock, Version=2014.1.1519.1, Culture=neutral, PublicKeyToken=721b6c5bc0326b3a, processorArchitecture=MSIL">
<HintPath>..\..\..\..\Program Files (x86)\Telerik\JustMock\Libraries\Telerik.JustMock.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<Private>True</Private>
</Reference>


I removed the Private and it did not fix the issue.
jmarbutt
#11 Posted : Thursday, April 17, 2014 2:59:39 AM(UTC)
Rank: Member

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

Was thanked: 1 time(s) in 1 post(s)
I just submitted a bug report
Remco
#12 Posted : Thursday, April 17, 2014 4:13:18 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 929 times
Was thanked: 1256 time(s) in 1169 post(s)
Thanks, I think I've figured this one out.

NCrunch isn't relocating/adjusting this reference because it exists under 'Program Files', which is usually referenced via the GAC or through absolute file path references.

The way this reference has been introduced would create problems if the project ever moved on disk - for example, if you moved the project up one level in your directory structure, the relative hint path would no longer be correct.

There are several ways you can solve this problem:
1. Move the Telerik.JustMock.dll to a directory within your solution (i.e. make a 'References' directory) and reference it from there. This is the most conventional approach, as the file is needed to build your solution and probably should be versioned alongside it if you are using a VCS.
2. Change the HintPath on the reference to be an absolute file path to the DLL. In this way your code can be copied around on the system without the relative path breaking.
3. Install the DLL file into your GAC using gacutil
jmarbutt
#13 Posted : Thursday, April 17, 2014 4:09:26 PM(UTC)
Rank: Member

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

Was thanked: 1 time(s) in 1 post(s)
Ok I figured out how to fix the issue. When you add the just mock reference, it has an option to copy the files to a shared directory instead of the install directory. I did not do that the first time. I added it that way and it worked.
1 user thanked jmarbutt for this useful post.
Remco on 4/17/2014(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.088 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download