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

Note: For VS15.3 MSTest issue, please follow https://resharper-support.jetbrains.com/hc/en-us/articles/115001221824-Debugging-MSTest-in-Visual-Studio-2017-3-15-3-Inconclusive-Test-not-run- 

 

Problem:

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

Solution:

0 out of 39 found this helpful
42 comments

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

 

 

4

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

0

@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)

0

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?

0

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

0

@alex sure

0

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.

0

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

0

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.

 

0

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.

0

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.

0

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.

0

@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

0

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

0

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!

0

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

0

@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.

0

I've just bumped into this as well this morning.   I had eight or so unit tests up and running with no issue.    I added one more and none of them work.  Hell, none of them show up in the testing window without a bit of digging around.   When I do get them displayed they all run and show Inconclusive: Test not run.

I'm a bit new to the ReSharper world so I'm not sure I follow the versioning format.   The link above says it is to 7.1.3 but when followed it shows 2017.1.2.    Is the '7' just the tail of the year?  And if so, that means the x.1.3 version isn't available, just the x.1.2.   

I just updated ReSharper to the latest and it is showing 2017.1.2 and I'm running on VS 2017 v15.0.26403.3

I'll keep digging and post anything I find that helps.

 

2


I am getting the same issue.

1

Unit tests (MSTest) run for me but I can't debug them. I have VS 2017 (15.3.0) and the latest Re-sharper. 

Any advice?

2

I made the switch to NUnit and everything works. Gave up on MSTest. 

0
Avatar
Nikiforov Aleksandr

there is no checkbox here with such name, any thoughts?

1

Having same issues with latest VS2017 and RE# 2017.1.3 (as well as EAP 2017.2).

Used to work on Windows 10. Set up same environment in Server 2016 and now I can't debug unit tests with re#.

Everything works when debugging through VS test console. Code coverage in re# works, running unit tests works, debugging is the only thing that doesn't work.

When I enabled logging this seems to be the error that I get:

--- EXCEPTION #1/2 [ArgumentException]
Message = “Process with an Id of -1 is not running.”
ExceptionPath = Root.InnerException
ClassName = System.ArgumentException
HResult = E_INVALIDARG=COR_E_ARGUMENT=80070057
Source = System
StackTraceString = “
at System.Diagnostics.Process.GetProcessById(Int32 processId, String machineName)
at System.Diagnostics.Process.GetProcessById(Int32 processId)
at Microsoft.VisualStudio.TestPlatform.Client.TestExecutorServiceClient.Initialize_NoLock(Architecture targetPlatform, FrameworkVersion targetFramework)
at Microsoft.VisualStudio.TestPlatform.Client.TestExecutorServiceClient.EnsureInitialized(IDictionary`2 environmentVariables, TestExecutionContext context)
at Microsoft.VisualStudio.TestPlatform.Client.TestExecutorServiceClient.<>c__DisplayClass17_0.<StartTestRun>b__0()
at Microsoft.VisualStudio.TestPlatform.Client.TestExecutorServiceClient.InvokeTestExecutorServiceAction(Action action)
at Microsoft.VisualStudio.TestPlatform.Client.TestExecutorServiceClient.StartTestRun(IEnumerable`1 tests, TestExecutionContext executionContext, String runSettings, IDictionary`2 environmentVariables, String dataCollectionServiceUri, ITestCaseLog testCaseLog, ITestRunLog testRunLog, IFrameworkHandleInternal frameworkHandle)
at Microsoft.VisualStudio.TestPlatform.Client.Rocksteady.RocksteadyExecutionManager.StartTestRun(TestRunCriteria testRunCriteria, Boolean inIsolation, DataCollectionParameters dataCollectionParameters, ITestRunEventsHandler runEventsHandler)
at Microsoft.VisualStudio.TestPlatform.Client.TestRunRequest.ExecuteAsync()
at JetBrains.ReSharper.UnitTestProvider.MSTest11.MsTest11Debugger.DoRun(IEnumerable`1 testCases, String settings, IUnitTestRun run, Action onRunCompletion)
0

I am having the same problem as Matt Newboult as I am unable to debug any of my unit test.  I am running VS Enterprise Version 15.3.1.  

0

I am getting similar errors.

Visual Studio Pro 15.3.1, Latest updates for Re-Sharper 2017.1.3. With latest XUnit 2.2.0
Tests run fine using VS test runner but Re-Sharper fails with error:

 

2017.08.21 11:17:42.337 ERROR Run: 34786ac4-414b-410e-9900-a413aa25fd4d - Faulted
2017.08.21 11:17:42.337 ERROR System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> JetBrains.ReSharper.UnitTestFramework.DotNetCore.Exceptions.ProcessExitedUnexpectedlyException: dotnet exited unexpectedly with the code (0)
Output stream: Microsoft (R) Test Execution Command Line Tool Version 15.3.0-dev
Copyright (c) Microsoft Corporation. All rights reserved.
Error stream:
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at JetBrains.ReSharper.UnitTestFramework.Launch.Stages.RunTestsStage.<>c__DisplayClassc.<StartSingleRun>b__8()
---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> JetBrains.ReSharper.UnitTestFramework.DotNetCore.Exceptions.ProcessExitedUnexpectedlyException: dotnet exited unexpectedly with the code (0)
Output stream: Microsoft (R) Test Execution Command Line Tool Version 15.3.0-dev
Copyright (c) Microsoft Corporation. All rights reserved.
Error stream:
--- End of inner exception stack trace ---
---> (Inner Exception #0) JetBrains.ReSharper.UnitTestFramework.DotNetCore.Exceptions.ProcessExitedUnexpectedlyException: dotnet exited unexpectedly with the code (0)
Output stream: Microsoft (R) Test Execution Command Line Tool Version 15.3.0-dev
Copyright (c) Microsoft Corporation. All rights reserved.
Error stream: <---
<---

 

Please advise.

0
Avatar
Francois Beauchemin

I've got similar issus than Alaninsley

 

Edited by Francois Beauchemin
0

Same issue... can't debug unit tests. They can be executed but not debugged
VS Professional 2017 (15.3.0 / 15.3.1)
Re-sharper Ultimate (2017.1.3)

Edited by Jbagagem
1

Just to update my original comment that I can't debug unit tests in VS 2017.  I still am unable to debug in 2017; however, I am able to debug the unit tests in VS 2015.  

1

Same here, just tried out latest update of VS2k17 as well as the latest version of ReSharper... the runner is also throwing the same exceptions...

Is there a fix out there?

1

+1 can't debug unit tests. They can be executed but not debugged. 
VS Professional 2017 (15.3.1)
Re-sharper Ultimate (2017.1.3)

2

Please sign in to leave a comment.

Have more questions?

Submit a request