vs2010 unit tests aborting for no reason - visual-studio-2010

We recently had our TFS 2008 server go down. It was rebuilt with TFS 2010 server. Now, when I selected VS unit tests and run, the first few are marked as "Aborted" and the others are "Not Executed"...
This happens without any input from me.
The unit tests were working fine before the crash.
What could be causing that?
Thanks.

I'm not sure but I have similar problem but on my local machine and with VS 2008. I cannot run some tests and have their status aborted with no reason. In the test run results I only have message "Test host process exited unexpectedly." Seems like with no reason. But I found more info on connect.microsoft.com site. The problem is my code rises StackOverflowException and it prevents the test from running. So fixing this problem heals my tests. Hope somebody it helps.
Unit test result only shows "aborted"/"test run error" for unrecoverable errors

I was getting this same issue, however in my case ALL tests were being skipped, and the error was reproducible on an empty test project, so code was ruled out.
Checking the EventViewer led me to the cause in my case; somehow the C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\QTAgent32.exe.config file had been removed from my machine?!? I copied one from another machine here and I'm back in action.

Same thing happened to me and as Mike said it was because I had a stack overflow exception somewhere in my code. As soon as I fixed the SO exception the problem went away. Finding the SO exception was quite hard, but I just had to step through the code until I finally found a recursive call that would cause an SO.

I suffered a similar problem which stopped me completely.
To get round it, firstly I ran the NUnit test via debug (TEST --> Debug --> All Tests) which allowed me to step through.
The error was related to the use of Entity Framework. If your project under test uses Entity Framework then the NUnit project needs a reference to EntityFramework and EntityFramework.SqlServer (or whichever provider you're using).

Related

Visual Studio crash when Deploy SSRS Report

Using Visual Studio 2013, when try to deploy the Report, the session Crash
I attach the messages
Do you have any idea to solve this issue?
by Event Viewer
I already followed this way - BUT the issue has not been resolved.
http://www.wkcerp.com/ax/crash-or-hang-during-ax-project-or-report-build-visual-studio-2013-ax-r3-cu8/
Thanks
I had the same issue here, and in my case the problem was a faulty installation of the SQL ADMd.Net components. Try and reinstall those.
There is a DLL, named Microsoft.AnalysisServices.AdmomdClient.dll, which could not be found in my case. This caused a stackoverflow exception in my case. The admin reinstalled those components, and the DLL got installed, too. Deploying reports is now possible :).
I figured this out by attaching one VS instance with debugging enabled to another VS instance, with which I tried to deploy reports.
Also, I had to enable debugging for .NET Code in the settings.
I set a breakpoint at the function
Mscorlib.dll!System.Runtime.TypeHandle.GetTypeByName
And that's where I noticed, that the same block functions were called over and over, trying to load the DLL, but not being able to find it. It is the nLoad function.
(https://referencesource.microsoft.com/#mscorlib/system/reflection/assembly.cs,460c8abec12d58cd).
This eventally caused the Exception, and the exception code 0xc00000fd, which is a Stackoverflow exception.
I can't post images here, but I hope it's still understandable.
Best regards,
Jannik.

RPC Server Unavailable error on TestComplete 11

I am hoping someone here can at least point me in the right direction to solving this frustrating issue. The smartbear community had no response.
I have a bunch of tests set up in TestComplete to test a web application. When I run them all at once, I consistently get an RPC Server Unavailable Error. I have no idea what this means. When I run the tests individually, there is no issue with the scripts.
I have tried running them in a script, calling them from a keyword test, and just using the project set up to call them all in order. No dice. Running each test manually completely defeats the purpose of automation.
Any ideas on how to fix this or at least where the F*** to start?? I did not have this problem with TC10, only when I upgraded to TC11
Thanks
So, in each of my modules, I was opening and closing Chrome. I decided to try taking out the close statement. Boom, no error. It still refreshes the page, which is fine. I don't know why this was a problem, but I got it to run all the modules concurrently

MSTest: No test discoverer is registered to perform discovery of test cases

I created a console application that was designed to be completely self-reliant and contain all the necessary DLLs to run. I was able to do this and get it to run locally, but when copying to another computer I began to receive this message...
"No test discoverer is registered to perform discovery of test cases. Register a test discoverer and try again."
I found this Microsoft bug report, but it was closed as could not reproduce:
https://connect.microsoft.com/VisualStudio/feedback/details/770093/unit-test-project-not-discovering-test-cases
I didn't want to sit around waiting for Microsoft to say they couldn't reproduce so I dug into it and found that the reason I was getting this error message is because I was missing the DLL file "Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll".
This is the file that contains the test discoverer and it needs to be in directory of the executable that is running the tests as well as the directory of the test files themselves. It is easy to miss because the assemblies to run the tests appear to be completely contained within the "Microsoft.VisualStudio.TestPlatform" namespace and the tests appear to only require a reference to "Microsoft.VisualStudio.TestTools.UnitTesting".
I decided to post this "knowledge share" post because there was no other information about the issue on the internet and Microsoft's documentation of their MSTest framework is bad at best.
Just come across this issue with some unit tests originally written in .Net 3.5 and running (or not) in vs 2013.
The UnitTestFramework.dll mentioned by Love2Learn was present however updating to .Net 4.5 seems to resolve the problem.
I'm sure someone out there can explain why but my gut feeling is that this has something to do with this being a multi-platform solution and that .Net 4.5 is just better at running 32bit unit tests against 64bit projects.

Resharper problem with unit tests

I'm having a little annoying problem with resharper trying to run my unit tests, using mstest. I can select an individual unit test and run/debug it fine but when I select the parent node to run a bunch of tests, the tests don't run; it just displays pending for a few seconds and then the test goes grey. If I set breakpoints in the tests and try again with the debugger, I get the same result and no breakpoints are hit. Has anyone else experienced this before?
For anyone using VS2012 update 2 (Charlie obviously wasn't when he asked the question, but for anyone else...), then make sure you have R# version 7.1.3 or later. At the time of this writing, the official release is 7.1.2 so you'll have to follow this link to go download it:
http://download.jetbrains.com/resharper/ReSharperSetup.7.1.3000.1964.msi
(as referenced from http://youtrack.jetbrains.com/issue/RSRP-339987)
Try to rebuild your test project/entire solution.
I sometimes have similar problems where the resharper shows tests that I have removed, or doesn't execute tests for new methods in the SUT project. After a rebuild it gets back in sync.
Ran into this problem aswell with ReSharper 5.0.1659 and VS2010. Turns out that the problem lies somewhere in the testrun config files that VS creates when running test the regular VS way. Removed them from both disc as well as references in solution file which solved the problem and I was able to run the tests with ReSharper again.

Unknown build error, 'Exception of type 'System.OutOfMemoryException' was thrown

We have VS.Net solution with 20 projects in it.
Occasionaly, in VS.NET, when we try to build/debug our solution, we get following error:
Unknown build error, 'Exception of type 'System.OutOfMemoryException' was thrown
Only way to "fix" this issue is to reopen Visual Studio and then solution build goes well, but again after some time OutOfMemory exception occur again. It's really annoying to reopen Visual Studio couple times a day, so do you know some workaround for this issue ?
JetBrains is aware of this issue, and they provide some fix for it, using this fix solved my problems for now:
http://www.jetbrains.net/confluence/display/ReSharper/OutOfMemoryException+Fix
Edit:
However, OutOfMemory exception is occuring again, but it's not as often as it is when I dont use this JetBrains fix.
According to what Microsoft recommends, it is not a good idea to have lots of projects within a single solution.
Check out this link http://support.microsoft.com/kb/949755 .
But the solution suggested in the article is not something that be straight away used, because of the code refactoring costs involved.
Have you tried building the solution from outside the IDE. (Something like MSBUILD). That might help.
I have the same Issue if I use ReSharper and run several UnitTests (with enabled CodeCoverage).
I also assume this is a ReSharper problem. And since I disble it while I'm running Unittest the Exception never appears again.
BTW - Disabling it when the exception throws (as mentioned in the comments above) doesn't help, because of disabling it while VS is running will not unload it from memory. The only way to force the unload is to tear down all AppDomains which have loaded the DLL. In a VS Package scenario this means you have to tear down the entire VS process :(
Or you can just minimize Visual Studio for about 10 seconds (see in task manager how the memory usage of devenv.exe drops when minimized). This works for me in most cases.I rarely have to close VS to get rid of this error.
VS reinstallation is temporary solution. Jus increase your machine Virtual memory size. this resolves this issue.
ref below link -
http://windows.microsoft.com/en-in/windows/change-virtual-memory-size#1TC=windows-7

Resources