Can't get the debugger working in Visual Studio Code?

0

So I have been working on a project C# project in Visual Studio Code, and need to make use of the debugging feature. However, when I run the debugger, I get the following message:

--------------------------------------------------------------------------------
You may only use the Microsoft .NET Core Debugger (clrdbg) with Visual Studio
Code, Visual Studio or Visual Studio for Mac software to help you develop and
test your applications.
--------------------------------------------------------------------------------
The specified framework 'Microsoft.NETCore.App', version '1.0.1' was not found.

  - Check application dependencies and target a framework version installed at:

      C:\Program Files\dotnet\shared\Microsoft.NETCore.App

  - The following versions are installed:

      1.1.0

  - Alternatively, install the framework version '1.0.1'.

The program 'c:\Projects\App1\bin\Debug\netcoreapp1.0\App1.dll' has exited with code -2147450749 (0x80008083).

My original understanding of the message was that I needed to change the project.json dependency file so that the line showing the version of Microsoft.NETCore.App was updated from 1.0.1 to 1.1.0. However, this didn't appear to make any difference. I've tried googling this message, but didn't really understand much of the discussion. Can anybody point me in the right direction for this one?

If there is any more information I could supply that would be of assistance, please let me know.

At present, my project.json looks like this:

{
"version": "1.1.0-*",
"buildOptions": {
"debugType": "portable",
"emitEntryPoint": true
},
"testRunner": "xunit",
"dependencies": {
"xunit": "2.2.0-beta2-build3300",
"dotnet-test-xunit": "2.2.0-preview2-build1029"
},
 "frameworks": {
 "netcoreapp1.1": {
  "dependencies": {
    "Microsoft.NETCore.App": {
      //"type": "platform", //remove this line if trying to build a native app via runtime section
      "version": "1.1.0"
    }

  },
  "imports": "dnxcore50"
  }
},
"runtimes": { //this section allows you to specify runtime for native build output, note these will not generate unless type:"platform" is commented out in dependancies
    "win10-x64": {},
    "osx.10.11-x64": {}
  }
}
c#
visual-studio-code
asked on Stack Overflow Feb 27, 2017 by jamessct • edited Feb 28, 2017 by Uwe Keim

1 Answer

1

Your app is expecting a 1.0.1 version of .NET Core, and you are actually running on a 1.1.0 version. I guess that you made a project in Visual Studio 2015, and then try to debug it in Visual Studio Code ?

If so, change the version in project.json to 1.1.0, dotnet restore, build and run again.

Visual Studio 2015 uses a Toolkit with version 1.0.1, while the .NET Core CLI is 1.1.0, so update your project dependencies to 1.1.0 & restore

answered on Stack Overflow Feb 27, 2017 by TanguyB

User contributions licensed under CC BY-SA 3.0