4
votes

I see the following error with Visual Studio 2015 (Tried both community and professional edition). Wrote a simple Visual C++ CosoleApplication which has "printf("Hello World\n");".

  1. Debug with Platform "x86" Compile and step through Works.
  2. Debug with Platform "x64" Compiles but when it runs it throws this error.

Code is simple with following lines:

// ConsoleApplication1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"


int main()
{
    printf("Hello World \n");
    return 0;
}

My desktop has following configuration: OS: Windows 7 Enterprise 64-bit version Anti-Virus: McAfee Anti-virus software running; Can't disable that. Firewall: ON (Can't disable that for security)

Question: Stepping through the code with (Debug x86 platform) works. Why "Debug x64 platform" does NOT work ?

Any suggestion would be helpful.

Thanks gshant

5
I uninstalled the whole package, restarted desktop and reinstalled with no effect.gshant
Looks like no one has faced similar issues! Could someone from Microsoft help? Support lines asks for $499 to start a conversation for this.gshant

5 Answers

0
votes

I was having the same trouble. This is what I did.

  1. Go to Project, Project properties.
  2. Select Application Tab and make note of what framework you are using. For me it was 4.5.2.
  3. Use the pull down to select a different Framework. At the bottom there is an option to install additional Frameworks.
  4. After the web page opens, select the Framework you previously noted and download the Development Pack.
  5. Close Visual Studio and install the Development Pack.

This worked for me when I selected x64.

Hope this helps you.

0
votes

Make sure you have both the x86 and x64 .NET Core runtimes installed.

https://www.microsoft.com/net/download/windows

0
votes

This answer deals with using IIS 7 to debug. I have not checked it with IIS Express.

If your web application is 32-bit (x86), you need to run IIS Manager and:

  • Look at the "Basic Settings" of your web site. Check what IIS
    application pool your project is using.
  • Look at the "Advanced Settings" of this application pool and ensure that "Enable 32-bit applications" is True.
0
votes

This was a firewall issue for me. I'm not sure the exact root cause, but I found stopping my firewall resolves this. If I find the exact root cause, I'll update my answer so firewall exception rules can be written.

I believe the issue is when you are debugging it is actually using the remote debugger still under the hood (connecting x86 Visual Studio to an x64 process, etc) and a firewall can block this.

0
votes

The solution for me was to go:

Project -> Properties -> Build -> Prefer 32-bit enabled

with Platform target -> "Any CPU".