MS Unit tests fails run half of the time - visual-studio-2010

I got this odd behaviour I launch tests from MS Test List Editor.
And first time I launch I always get this error currently
Error 11/15/2011 4:28:32 PM Failed to queue test run 'USER#MACHINE 2011-11-15
15:28:29': Unable to start program 'C:\Program Files (x86)\Microsoft
Visual Studio 10.0\Common7\IDE\QTAgent32.exe'.
Next launch is fine
I reproduced it 40 times already. Just as if first launch is clearing way for second one.
What could be the cause?

As Hans pointed out its a known issue.
http://connect.microsoft.com/VisualStudio/feedback/details/536475/launching-unit-tests-in-debugger-fails-every-other-time-cannot-start-qtagent32-exe
Its hard to reproduce and in my case I was able to fix it by reloading VS 2010.

Related

"file is locked" when visual studio executes unit test

I developed near 300 unit tests, but sometimes, when trying to develop new tests, or just execute old tests, I got below error (for some of assemblies):
Could not copy "X.dll" to "bin\Debug\X.dll".
Exceeded retry count of 10. Failed.
The file is locked by: "Microsoft Visual Studio 2019 (37736)"
After that only restarting visual studio resolves problem. Normally this error will be thrown when I changed tests or library and try to execute test again.
Any idea how can I resolve this error?

Visual Studio 2017 is preparing tests longer than expected

From one moment (not fixed when it happened, probably, when I moved some test projects to another folder on disk) Visual Studio is taking longer than expected when I open Test Explorer and want to run tests. It takes minutes like this:
Why it happened and how to fix it?

Visual Studio 2015 builds failing because pre-build event 'requires elevation'

I have a very simple VS2015 solution with one project. The project does not have any source code, but it has a pre-build event defined. The pre-build event was originally invoking a batch file pb.bat, but I have since changed it to REM pb.bat so that it only executes the REM statement.
Every time I try building, I get the following error message:
Microsoft.Common.CurrentVersion.targets(1250,5): error MSB6003: The specified task executable "cmd.exe" could not be run. The requested operation requires elevation
I should note that UAC is disabled. This is driving me crazy! I have even tried reinstalling Visual Studio, in case the targets files or something else was corrupt with the installation, but the problem persists. If I run Visual Studio as an Administrator, the build works, but I don't want to have to run it like that forever!
I had completely forgotten about this! A couple of days ago I had configured cmd.exe to always run as an Administrator. This was done in the registry:
[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
"C:\\Windows\\System32\\cmd.exe"="RUNASADMIN"
The problem went away as soon as I reverted the change. I am making a note of this, as I am bound to hit the same problem in the future.

fatal error LNK1201: error writing to program database - Visual Studio 2003

I get this error: fatal error LNK1201: error writing to program database every time I edit my code and build again in visual studio 2003.
The issue is resolved if I restart VS2003 but I need to do this every time i build the project.
I have been googling and stackoverflowing ;) for a few hours and have tried the following proposed solution:
Change the Debug Information Format from Zi to Z7. (Property -> C/C++ -> General -> Debug Information Format)
This did not work
Change Visual Studio Compatibility Mode to Windows XP SP3
This did not work
Add the following in the Pre-Build Event : net stop "Machine Debug Manager"
net start "Machine Debug Manager"
This produced the following error: System Error 5 has occurred. Access is denied. This could be because I do not have Admin Access on this machine.
I have not tried this one because I am not allowed to download untrusted code at my work. Run FreePDB.cmd posted by Tony76 here
Changed the Symbol Path as seen here:
This did not work
What I know:
This error could occur if the pdb file exceeds 1GB but mine is only 10MB.
My limitations:
I do not have Admin Access on this computer
Cannot run untrusted software (Work Computer)
I came across the same problem when I was moving my VS project from old disk to new PC. Deleting all debug files eliminated the issue, maybe Clean-Build would solve it as well, but that is not what I have tried.
I use a program called LockHunter to unlock the PDB file. This works, though from time-to-time if stops successfully unlocking (or recognizing that the PDB file is locked) and I have to restart my PC
Had similar problem on Windows 10. This answer provides a solution using a tool called FreePDB. Worked for VS2003.NET, but apparently this solution works for multiple versions of Visual Studio.
Had similar issues when the solution was open in both VS2017 and VS2013. Fixed this issue by closing both the visual studio instances and re-opened the solution file.
Quick fix for some cases, close all msbuilds and running instances, some prior run may crashed and holding the some files/pdb
I had this issue in VS2017. Deleting the PDB mentionned in the error solved it for me.

Visual Studio 2010 crashes after build

I have a VB.Net windows forms application that has been around for a very long time. I am working the project in Visual Studio 2010 Premium, on my Windows 7 x64 workstation. Everything has been going along fine till a couple days ago. No every time I build this project Visual Studio 2010 crashes.
The only thing i have to go on is this from another Visual Studio 2010 instance that attached the debugger to the dieing process.
...
The thread 'Win32 Thread' (0x177c) has exited with code -2147023895 (0x800703e9).
The thread 'Win32 Thread' (0xc44) has exited with code -2147023895 (0x800703e9).
The program '[4224] devenv.exe: Native' has exited with code -2147023895 (0x800703e9).
No one else on my team has this issue, and I don't have problems with any other projects.
This is .Net 4.0.
Any thoughts or suggestions are much appreciated,
Beezler
It might be wise to start VS with the /safemode parameter.
I also had this problem and I solved it by uninstalling the Achievements extension.
Do you have any modifications whatsoever to the solution/projects/code that are different from the team members not experiencing the crash? Have you tried getting a fresh-cut of the source to a different directory and trying to build that?
Another thing to look at would be to disable any add-ins/extensions you might have installed.
I had the same problem but with C++ projects. They ran fine for a while, then all of a sudden just started crashing on every build. This fixed it for me:
To fix: click start, type "cmd" into the search box, right click "cmd.exe" in the search results, select "run as admin", then run this command: regsvr32 "C:\Program Files (x86)\Internet Explorer\ieproxy.dll"
Reference: http://connect.microsoft.com/VisualStudio/feedback/details/533194/crash-while-compile-an-extremely-simple-c-project
If that doesn't work, the plugin AnkHSVN is known to cause the same problem. http://blogs.msdn.com/b/visualstudio/archive/2010/05/11/if-you-are-seeing-intermittent-crashes-with-vs-2010.aspx
This is weird and i've also faced a similar issue like that. First i add a watch to a class. and when i try to drill to details of class collection, process terminates and debugging stops.
I've figured out that, it is giving stackoverflow error code. Base of the exception was just because of infinite loop.
So i re-checked all collections twice to find the property that causes a loop. like
int a {get {return MethodThatAlsoReturnsA();}
hope it helps s.o.

Resources