It works in Visual Studio 2012 using the ReSharper test runner. xUnit.net is used as unit testing framework. I'm calling a .msbuild file, which looks like this:
<
Project
DefaultTargets
=
"Build"
xmlns
=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<
Import
Project
=
"C:\Program Files (x86)\Telerik\JustMock\Libraries\JustMock.targets"
/>
<
UsingTask
AssemblyFile
=
"$(MSBuildProjectDirectory)\..\packages\xunit.runners.1.9.1\tools\xunit.runner.msbuild.dll"
TaskName
=
"Xunit.Runner.MSBuild.xunit"
/>
<
Target
Name
=
"Build"
>
<
JustMockStart
/>
<
xunit
Assembly
=
"bin\Release\WebshopNG.Tests.dll"
/>
<
JustMockStop
/>
</
Target
>
</
Project
>
Superfluously, before calling msbuild.exe I set the following environment variables:
COR_ENABLE_PROFILING=0x1
COR_PROFILER={b7abe522-a68f-44f2-925b-81e7488e9ec0}
I keep getting the following error in the event log:
.NET Runtime version 4.0.30319.17929 - Loading profiler failed. COR_PROFILER is set to an invalid CLSID: '{b7abe522-a68f-44f2-925b-81e7488e9ec0}'. HRESULT: 0x800401f3. Process ID (decimal): 5576. Message ID: [0x2502].
I've tried re-registering the Telerik.CodeWeaver.Profiler.dlls, but that did nothing. Googling the error yields nothing concrete, so I'm at a loss where to start.
10 Answers, 1 is accepted
Thanks again for contacting us. Here are few things that you can do:
1. You can try running it using JustMockRunner console app and see if that works. More information on this can be found at this post:
http://www.telerik.com/help/justmock/scenarios-running-jm-profiler-outside-visual-studio.html
2. Make sure that you have copied the Telerik.CodeWeaver.Api.DLL to the folder where Telerik.JustMock.DLL is located.
3. Please also try configuring the tests in build server using code activity workflow that ships with Justmock. Details on this can be found here:
http://www.telerik.com/help/justmock/integration-code-activity-workflow.html
4. Finally, I will investigate more on this in coming days to see if doing the same in VS 2012 also fails my tests.
Kind Regards
Mehfuz
the Telerik team
Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.
2. I did and now I got a different message in the event log when running it from MSBuild:
.NET Runtime version 4.0.30319.17929 - The profiler has requested that the CLR instance not load the profiler into this process. Profiler CLSID: '{b7abe522-a68f-44f2-925b-81e7488e9ec0}'. Process ID (decimal): 4016. Message ID: [0x2516].
3. We're not using TFS, we're using Mercurial and TeamCity for our SCC/CI needs.
4. The tests do succeed in VS2012. It's just that they don't succeed outside of Visual Studio.
Thanks again for contact us.
Are you using a local system account in your build machine? In that regard, I would ask you to go to your environment variable settings and set JustMock instance variable in the following way:
Next, restart the machine and see if that solves your issue. Here is the link the from Microsoft that has more information on it:
http://support.microsoft.com/kb/821761#appliesto
Kind Regards
Mehfuz
the Telerik team
Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.
could you please explain how JUSTMOCK_INSTANCE variable works ?
Because I struggled one day with investigation how I can use justmock tests with profiler requests in my build process without changing build processing such as adding JustMockRunner activity and after that I found that setting up JUSTMOCK_INSTANCE to "0" works when I set it for process who would start MsTest.exe
It's great to hear that JustMock is now running perfectly in your build machine. Should you find any other issues please don't hesitate to contact us.
Kind Regards
Mehfuz
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
I too need have the need of running the unit test case from msbuild using mstest in TFS. We want to use mstest specifically in the TFS 2010. So . My test case running perfectly fine from Visual 2010 by enabling profiler on from the Telerik menu in visual studion 2010.
Can you help me to get the step of configuring the existing TFS build definition so that profiler is enabled. As of now the error is profiler need to enabled.
Thanks
Mohd Moyeen
mohd.moyeen@allscripts.com
How do I find the solution in forum thread ID - 701028?
Thanks.
In order to integrate JustMock inside your build process, please check our integration articles. There are workflows about configuring JustMock for different TFS version, using code activities or just MSBuild Tasks.
However, if the above mentioned guides do not help you out, please share what the exact issue is and we will be happy to assist you further.
As an addition, you could check this article for known issues that may cause you troubles.
I hope this helps.
Regards,
Kaloyan
Telerik