Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio executable run twice

I have a problem with my computer : windows 7-64, freshly and cleanly reinstalled.

When I develop on Visual Studio 2010 Ultimate SP1, once the application is built, it runs twice.

Let me explain.

If I double clic on it in the folder, the console application runs, block for a few seconds (depending of the complexity of the program), then closes, the re-opens, runs and is stable.

If I launch it in a console, another console opens (like a pop up), runs the program, closes, then the program is executed in the first console.

If I launch it in debut with a break point, the application opens in a first console, executes without stopping, then closes, the relaunch in another console, et stop at the break point.

However, if I try other command non related to Visual Studio built (as firefox ...) I don't have this problem.

I've tried with a simple "Hello World" or with much more complex program, and I always get the same result.

Does anyone have already seen this kind of thing or now where to dig ?

Thank you.

Grégoire

like image 908
Grégoire Avatar asked Jul 22 '14 13:07

Grégoire


People also ask

Can you run multiple instances of Visual Studio?

No, you can't run multiple instances of your application from Visual Studio. Features like "Edit and Continue", for example, can only work if there's a single instance. You can, however, run multiple instances from outside of Visual Studio, but you'll lose some of these fancy features.

How do I run the same project twice in Visual Studio?

Build your project once. Add the multiple . exes as "Projects" (right-click folder > Add > Existing Project, then select your exes, one by one) Now you can set up your "Multiple StartUp Projects" to launch all 5 "projects", and debug them at the same time.


Video Answer


4 Answers

I've had this same problem recently, mine was solved by disabling Avast DeepScreen (if you use avast go into settings -> antivirus -> un-check DeepScreen). Hope that helps.

like image 55
Neller Avatar answered Oct 08 '22 13:10

Neller


Updating Neller's answer. In my case it was also Avast, but today the option you need to disable is called "Cyber Capture"

Press the Hamburger to open the menu => Settings => Protection tab => Core Shields => uncheck "Enable CyberCapture"

like image 37
Yonatan Nir Avatar answered Oct 08 '22 13:10

Yonatan Nir


They updated the settings page, you now have to uncheck CyperCapture under the 'General' tab.

Alternative you can add your program to 'Exclusions'.

like image 37
Frederik Nygart Avatar answered Oct 08 '22 13:10

Frederik Nygart


To expnad Neller's answer, this behaviour is common in various Antivirus Systems. More precisely I have come across it both on AVG and Avast. To avoid this behaviour you can simply add a folder scan exception regarding Visual Studio Folder.

e.g for AVG:

Mennu -> Settings -> Exceptions -> Add:

C:\Program Files (x86)\Microsoft Visual Studio 12.0*

like image 1
apomene Avatar answered Oct 08 '22 13:10

apomene