Answered by:
Can't debug a Coded UI application in VS 2012

Question
-
I am using VS 2012 to create Coded UI tests, but the debug mode doesn't work.
First, it just threw the following error :
"A project with an Output type of Class Library cannot be started directly. In order to debug this project, add an executable project to the solution which references the library project. Set the executable project as the startup project".
I added a console application to the project and follow the above process, and then obtained another error :
"Error while trying to run project: Unable to start program ........ Unable to load a Visual Studio component (symbollocator.resources.dll). If the problem persists, repair you installation via 'Add or Remove Programs' in Control Panel"
After checking, the dll was in the following folder : C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Packages\Debugger\1033.
I even looked in the regedit for the key :
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config\CLSID\{896CBC6E-3117-4AE6-80F9-5B8619581BDA}
which has the correct properties.
I finally repaired the VS Installation, whithout any change. A colleague of mine is reproducing the same issue on her computer.
FYI, we have got VS 2012 update 4.
Can anyone help me in this issue?
Regards
Thursday, September 18, 2014 1:22 PM
Answers
-
Hi Alex_p1,
One possible reason is that the installation files of your VS2012 premium with Update 4 are corrupt. Another possibility is that your VS2012 Premium with Update 4 is OK and the error is a bug on Visual Studio 2012.
In order to check whether the files of VS2012 with Update 4 is right, I suggest consulting Visual Studio Setup and Installation forum: http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vssetup Visual Studio installation experts will provide you better support.
If the files of VS2012 are right, then I am afraid that you have to buy the license of VS2013 for the long-term because Microsoft Product team has not accepted issues on Visual Studio 2012.
If you have MSDN subscription, you can download and use VS2013 directly from MSDN Subscriber download: https://msdn.microsoft.com/en-us/subscriptions/securedownloads/hh442898
Best regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- Proposed as answer by Amanda Zhu Wednesday, October 8, 2014 1:24 AM
- Marked as answer by Amanda Zhu Thursday, October 9, 2014 7:52 AM
Monday, October 6, 2014 6:06 AM
All replies
-
Hi,
Don't use F5 or the standard debug toolbar option to start debug mode for a Coded UI test, either press CTRL+R, T with the cursor in the context of the test or right click the test code and select debug tests.
You can also run tests from the Test Explorer (and this has a debug option too).
Good luck,
Thursday, September 18, 2014 1:50 PM -
Hi,
Don't use F5 or the standard debug toolbar option to start debug mode for a Coded UI test, either press CTRL+R, T with the cursor in the context of the test or right click the test code and select debug tests.
You can also run tests from the Test Explorer (and this has a debug option too).
Good luck,
Hi Dominic,
I forgot to precise that I already avoided to use F5, but neither the right click way, nor the Test Explorer works.
I always get in the output pane : "A process having ID -1 is not executed."
But thanks for your answer, though
- Edited by alex_p1 Thursday, September 18, 2014 1:57 PM
Thursday, September 18, 2014 1:57 PM -
The first Microsoft error message you quoted is misleading. You should not follow the instructions it gives if you are using Coded UI.
Dominic gave the correct answer.
I suggest you remove the console application from your Coded UI test project and try again. If that does not work then create a brand new Coded UI project (just a very simple one). Try runing and debugging this new simple project using the methods in Diminic's answer. Assuming that this project runs and can be dubugged then you know that the problem is purely within the first project.
Regards
Adrian
Thursday, September 18, 2014 3:03 PM -
Hi Alex_p1,
Coded UI test project is a library project, you can’t debug it through F5 or Debug->Start debugging directory. We can debug coded UI test through right clicking the coded UI test method in Test Explorer and selecting ‘Debug selected tests’. So please remove the console application from the coded UI test project and then debug the coded UI test from Test Explorer.
Another way to debug the coded UI test project is to create an executable application, calling the dll from the executable application instead of calling the executable application from the dll project and then debug the executable application as the error messages said. For more information, please see ‘Ways to debug the DLL’ section in this document: Debugging DLL Projects
Best regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.Friday, September 19, 2014 6:47 AM -
Hi AdrianHHH,
HI Crystal Zhu,
I tried to debug a brand new simple CodedUI project without a console application, with the right-click menu, but still without success (with the output : "A process having ID -1 is not executed.")
I also tried to debug calling the dll from the executable application, but I realized that I canno't even debug a simple Console Application or Windows Form Application (again, the same message that I stated sooner : "Error while trying to run project: Unable to start program ........ Unable to load a Visual Studio component (symbollocator.resources.dll). If the problem persists, repair you installation via 'Add or Remove Programs' in Control Panel")
Friday, September 19, 2014 8:44 AM -
Hi Alex_p1,
It seems that your VS is corrupt. Please repair or reinstall your VS from Control Panel.
Best regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.Friday, September 19, 2014 9:59 AM -
As I said in my first post, I already repaired VS from Control Panel, and even made an installation on a brand new computer without any previous installation of .NET Framework or VS.
It changed absolutely nothing. As I said, I checked for the DLL supposed to be missing, but it already was in the correct folder...
I really have no idea where the problem comes from.
Friday, September 19, 2014 10:05 AM -
Hi Alex_p1,
Sorry for my mistakes.
I found someone got the same issue with you, please see: https://connect.microsoft.com/VisualStudio/feedback/details/783607/cant-start-program-rel-and-deb-after-vs2012-update-2
I doubt the issue is on your system. Which operation system are your machines? I have two suggestions for you:
1. Create a new user account and run VS to debug a simple windows forms app. If you can run without problem, your user profile is corrupt and you have to create a new account and copy current user info to it. http://windows.microsoft.com/en-IN/windows7/fix-a-corrupted-user-profile It is for Win 7.
2. Do some file check or repair on your OS. Such as Sfc /scannow http://support.microsoft.com/kb/929833
Best regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.Friday, September 19, 2014 10:17 AM -
Thanks for your reply, Crystal Zhu
Unfortunately, Sfc/ scannow did not find any integrity violation. And with a new user account, I still get the same issue.
Does any fixing has been found by VS Team related to the issue you gave me the link above ?
Friday, September 19, 2014 11:55 AM -
Hi Alex_p1,
Microsoft team did not reproduce this issue because customer did not response and provide enough information, so I am afraid that there is no fix for this issue in VS2012. Because Microsoft product team has not handle issues on VS2012 or older VS than VS2013, my suggestion is that you reinstall your system and install VS on a clean system in order to work with VS2012.
Best regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- Proposed as answer by Amanda Zhu Monday, September 29, 2014 1:31 AM
- Unproposed as answer by alex_p1 Monday, September 29, 2014 6:41 AM
Monday, September 22, 2014 5:37 AM -
Hi Crystal Zhu,
As I said in a previous post, I already made an installation on a brand new computer without any previous installation of .NET Framework or VS.
That did not resolve the issue.
Regards,
Monday, September 29, 2014 6:42 AM -
Hi Alex_p1,
Since this issue also occurred on your colleague’s machine and another branch new machine, whether your machines are the machines of your company? One possible reason I can think of is that your VS2012 installation files are corrupt. Could you please download a trial Visual Studio 2013 Ultimate with Update 3 and install it on your machine from here: http://www.visualstudio.com/downloads/download-visual-studio-vs , create a coded UI test and then debug it to check the result?
If VS2013 Coded UI test can work fine on your machines, then your VS2012 with Update 4 is corrupt.
Another reason is that there is anything wrong with your machines or something on your machines affected VS2012. Whether there are some third-party software running on your machines? If yes, please disable them temporarily and debug the coded UI test to check the result.
Best regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.Monday, September 29, 2014 6:58 AM -
Hi Crystal Zhu,
I installed VS2013 Ultimate Update 3, and I am able to debug my CodedUI Projects, so it seems that the problem comes from our VS2012 premium Update 4 files.
But since it is a trial version and we don't have VS2013 ultimate licenses in my company, that doesn't resolve my problem for the long-term.
Tuesday, September 30, 2014 12:09 PM -
Hi Alex_p1,
One possible reason is that the installation files of your VS2012 premium with Update 4 are corrupt. Another possibility is that your VS2012 Premium with Update 4 is OK and the error is a bug on Visual Studio 2012.
In order to check whether the files of VS2012 with Update 4 is right, I suggest consulting Visual Studio Setup and Installation forum: http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vssetup Visual Studio installation experts will provide you better support.
If the files of VS2012 are right, then I am afraid that you have to buy the license of VS2013 for the long-term because Microsoft Product team has not accepted issues on Visual Studio 2012.
If you have MSDN subscription, you can download and use VS2013 directly from MSDN Subscriber download: https://msdn.microsoft.com/en-us/subscriptions/securedownloads/hh442898
Best regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- Proposed as answer by Amanda Zhu Wednesday, October 8, 2014 1:24 AM
- Marked as answer by Amanda Zhu Thursday, October 9, 2014 7:52 AM
Monday, October 6, 2014 6:06 AM