Knowledge Base/ReSharper FAQ/Usage, Features and Known Issues/Bugs

MSTest Unit Testing does not work (or fails with error) with ReSharper 7.1.x

Alex Berezoutsky
posted this on May 23, 2013 12:44

Problem:

If you're having one of the following issues with ReSharper 7.1.x (possibly, with Visual Studio 2012 Update 2):

Solution:

screen432.png

 

Comments

User photo
Eino Makitalo

There is no such option in Resharper C# 7.1.3 :-(

 

 

June 14, 2013 11:53
User photo
Alex Berezoutsky
JetBrains

@Eino, you need to have your solution opened in order to see the other options.

June 14, 2013 13:40
User photo
Eino Makitalo

@Alex Yes, you are right.  I also find out that this QtAgent32 stopped working is nuisance only with NET 3.5. When I changed my project to 4.0 I have no problem of running tests. (Resharper 7.3 C# edition)

June 15, 2013 13:19
User photo
Yyaari

Hi, My team is running ReSharper 7.1.3 (Build 7.1.3000.2254) on Visual Studio 2010, an the fix above doesn't work.

any thing else you can advise?

June 20, 2013 16:07
User photo
Alex Berezoutsky
JetBrains

@Yyaari, could you please submit a request for us with a detailed information about this issue. We'll try to help. Thanks!

June 20, 2013 16:11
User photo
Yyaari

@alex sure

June 20, 2013 16:18
User photo
Moramatte

I have the same problem:

Just went from using [DeploymentItem] for the files used by my tests, to not working with deployed MSTests at all. (Not copying files to the TestResults folder. Instead run directly from bin/Debug) This is controlled with a testsettings file. 

This works fine with Visual Studio´s runner and with the TestDriven runner. However the Resharper runner does not seem to respect the settingsfile even though Resharpers Options dialog finds it and allows me to select it. 

Note that the Resharper runner did manage to run my MSTests the old way, when we did not use a testsettings file. Now it has stopped finding the files.

June 27, 2013 16:02
User photo
Keith Nicholas

I'm also having the same problems,  Its working directory seems to not be the output working directory  (v7.1.3)

August 05, 2013 02:40
User photo
Joao Morais

Same issue with v7.1.3 or v8.0+Fixes with Visual Studio 2010 SP1 and projects using .NET v4.0.

By looking at the TestContext object, it looks like ReSharper runs the tests from the Project output folders, and MsTest from the TestResults folder (at the same level as the solution in my case).

I know there is an option to change the folder from which ReSharper runs the tests from, but none to set it like MsTest, i.e. at the same level as the solution file or (.vsmdi file). I tried to force it by providing the full physical path to my solution folder, but still the same issue.

So, right now, when running all the test in the solution, I am still using MsTest and I use only ReSharper to run test that do not required files or folders to be deployed.

 

August 30, 2013 17:23
User photo
Mans

I'm also having this problem. I have been running my tests from resharper for some time now and it has been working just fine. But, recently I had to force tests to run in 64-bit mode and since Resharper does not support that out-of-the-box I had to create a testsettings file and point resharper to that file. But, when I did I got exactly the problem described above by Moramatte, Keith Nicholas and Joao Morais.

October 31, 2013 14:19
User photo
Krishnendu Das

We are having issues after upgrading to the ReSharper 8. Previously we were using ReSharper 5.1. With that version, during the execution of the MS Test using ReSharper, it was creating separate ‘Run Deployment Directory’ for each session/Test Run. Please refer to the screen shot below.

However, after upgrading to ReSharper 8 yesterday, we are no longer getting the Results in ‘separate Run Deployment Directory’. ReSharper is using the existing ‘Run Deployment Directory’ for each session/Test Run. Please refer to the screen shot below.

November 07, 2013 23:28
User photo
Steveb

I had to downgrade to 7.1.3 as well.  R#8 on VS2010 would continuously get stuck on unit tests as soon as there were 10 or more to run a single group.  Very disappointing that this issue, which has been reported by many, has still not been fixed.  It makes R#8 effectively useless, but worse, it makes me never want to upgrade again.

December 03, 2013 00:22
User photo
Alex Berezoutsky
JetBrains

@Steve, have you tried Resharper 8.1 EAP? There are lots of improvements there. Link is: http://confluence.jetbrains.com/display/ReSharper/ReSharper+8.1+EAP

December 03, 2013 15:51
User photo
Tim

Hi,

 

I 've upgraded to 8.1 and still have the issue. It's consistent, but doesn't throw any exceptions. The test runner hangs at the same point each time, with the same tests. There is 6 test classes hanging at the same time. I've checked the tests themselves and can't see a specific issues (explicit thread lock or anything). Once I click the button to stop the execution, all other tests run to completion. The net result is 25 tests that never get executed. 

I personally elected to by R#8, but have had to warn the client about upgrading their staff to eight because of this. 

I doubt it's related, but the Mocking technology of choice is RhinoMocks. Other than that, there shouldn't be anything causing the issue. 

Tim

December 20, 2013 14:05
User photo
Alex Berezoutsky
JetBrains

Hi Tim,

Any chance we can get this solution for investigation, if there's a consistent repro? Please use the 'Submit a request' form above to send it to us. Thank you very much in advance!

December 20, 2013 14:27
User photo
Portelli Nick

Same issue here.  A mstest with datasource attribute works in VS test runner.  Fails in R#'s.  Beginning to lose confidence in Jetbrains.

January 02, 2014 22:51
User photo
Tim

@Alex. I've attached a zip file with an example in. It's a very basic sample, but when I run the one MSTest test via resharper it hangs and fails to come to a conclusion. I included an MSpec based version of the test which runs fine when the MSTest test is commented out (as in sample). However, when you uncomment the MStest, the MSpec based test fails to complete. I'm not getting anything back in the test runner to indicate a problem. 

Hope that this helps. Incidentally, the path the MS test dll is C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll. I've no idea whether this has any implications or not. I'm going to try a local copy. 

I'd sooner runner my tests through resharper than MSTest/VS so it'd be great if you could resolve the issues. 

See attached.

January 28, 2014 17:36