Visual Studio 2013 runs project twice
Asked Answered
A

3

14

When I press the "Local Windows Debugger" button when working on any basic C++ project in Visual Studio 2013, the console opens and the program outputs, but when the console closes, another console opens, the UI changes slightly and the program outputs again.

Steps to reproduce:

  1. Create a new C++ project enter image description her

  2. Inside the "Source Files" directory of the new project, create a file named "main.cpp"

  3. Put a basic hello world program into the file:

    #include <iostream>

    using namespace std;

    int main() {
        cout << "Hello world!";
        cin.get();
    }

  1. Save the code and press the "Local windows debugger" button on the toolbar

  2. A console opens, and waits until you press enter

enter image description here

After the first console closes, a new one opens up, and the UI changes: enter image description here

Edit: Link to download a zip folder containing the project: Test Project.zip

Alicaalicante answered 24/7, 2014 at 19:3 Comment(5)
I followed your steps and this does not happen to me.Hindustan
Can you post the project being generated? The answer might be in the proj file itself.Namely
I added a link to download a zip containing the project: mediafire.com/?nnxd4hup2u25tpgAlicaalicante
This doesn't repro in my VS2013 using that project, plus the project looks fine. Does this only happen on Debug configuration? Does anything interesting pop out from "Debug" in the output window?Namely
Just a small addendum: Threatfire (afaik no longer available as a standalone) causes massive slowdown of visual studio when starting projects.Margoriemargot
A
32

I had avast deepscreen enabled. To disable, goto avast user interface -> Settings -> Antivirus and uncheck the box that says "Enable Deepscreen"

enter image description here

Alicaalicante answered 25/7, 2014 at 6:54 Comment(5)
Hmm. Now I remember that. I actually had this 6 months ago but forgot. I eventually uninstalled Avast because it had way too many false positives with executables and dlls that I build as a software developer who has projects that are 2 decades old..Scrip
Great answer @Alicaalicante How did you figure out this was causing the problem?Panoptic
Only Avast would consider running a virus twice. Get rid of it completely, it is junk.Much
It runs unknown applications in a sandbox for a few seconds to determine if the application has any virus like behavior. If not the it will re run the application normally.Scrip
never thought I would find a solution to this problem, but this solves it. Who thought avast would do this?! Great Answer +1!Coincidence
C
1

On a new version of avast you need to uncheck CyberCapture option. To disable CyberCapture you need to open Avast->Settings->General and uncheck "Enable CyberCapture" enter image description here

Cordula answered 25/8, 2017 at 9:52 Comment(0)
M
0

I had same problem. Added exception to "c:\source\" where all my visual studio stuff is located.

Maurreen answered 4/5, 2019 at 15:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.