Pressing F5 in Visual Studio 2010 creates but does not launch the application

I have a Click Once (WPF) application in C #. Initially, when I hit F5 to debug / run the application, it worked smoothly. In the end, F5 will only build the solution and not launch the application (so I could not go through my code). For some time I switched from Debug to Release mode and for some reason allowed the application to start after using F5, and I was able to execute my code again. But now it no longer works. In short, I cannot get the application to work in such a way that I can go through the code. I can only start without debugging (Ctrl + F5). Obviously, this is not enough for me, except to tell me whether the application works or not.

+4
source share
8 answers

You probably lost the startup project in the solution, or the running project is confused, and the correct "element" was not set for the launch.

Right-click on one of your projects and select: define as a startup project. Then try again to do the trick. If not, check the properties of the projects to see if the form or something is specific as the launch object for this project.

Edit: Obviously, do not set the class library project as a launch project, but select your interface :).

+2
source

What worked for me today was to open the task manager and look for any debugging programs that did not finish properly.

Task Manager > Processes > kill all programs "*.vshost.exe *32" 
+7
source

I had the same problem today and I came here to find help. I tried all the suggestions here and nothing helped.

Seeing that my solution was a simple console application, I recreated it from scratch. The new solution did not reveal any problems, so I started comparing them.

I reset the solution and project files so that they are identical (except for the project GUID, name and root namespace), but the first solution has still not been executed.

Then I tried to delete the suo files and the bin and obj folders. However, the first solution did not start.

Finally, I noticed that the vshost.exe process is still working for the project. When I killed him and rebooted, it all started right.

+2
source

If the same problem, in the end, tried to remove all breakpoints, and debugging started working again. But find out why, but at least it works.

0
source

I had this problem today. The solution turned out to be slightly turning in the problem with * .vshost.exe mentioned earlier.

I could create the application just fine, but msvs refused to run it. I could start the application manually, and the timestamp in the file indicated that it was a really new build. * .vshost.exe did not appear in the task manager, so I could not finish the process as suggested.

When all else failed, I tried to delete the .exe file and found that * .vshost.exe would not be deleted because it was in use. The error message showed that this is actually a steam client (third-party software) that somehow captured my * .vshost.exe file and "used" it. Do not know how and why. In any case, I completely turned off the steam, after which he allowed me to remove * .vshost.exe. After that, creating and starting from msvc worked fine.

0
source

As well as the ghost * .vshost.exe. It may also be that you have the same Solution / Project open in a different version of VS. I had the same solution open in both VS2010 and VS2015, and when working in VS2010 it compiled, but did not start. The closure of the VS2015 solution and it performed as expected.

0
source

After several years of using VS 2008, I suddenly had a problem with F5 not starting the application. There should be dozens of different sentences - I tried a few. Someone suggested a virus. My Microsoft Security Essentials did not update automatically (usually this is a problem), so I manually updated it. He detected a virus, deleted it, and the F5 problem disappeared!

0
source

If this problem tried to delete everything in the bin / debug folder, but the vshost.exe file could not be deleted, he continued to request administrator permission and then still could not delete it, even if it was run from the administrator account. Rebooted, the file disappeared, and f5 worked again.

0
source

Source: https://habr.com/ru/post/1400287/


All Articles