Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while installing .NET Core Debugger on OSX

I've installed the latest version of Visual Studio Code (1.1.1) in OSX El Capitan (10.11.4). I also installed the latest version of Core RC2. dotnet --version gives me 1.0.0-preview1-002702. One of the web threads I read said to delete the older version of OmniSharp and install the latest, which I did. I also installed OpenSSL via Brew.

When I installed the newest yo generator for aspnet and created a sample app, it runs fine. When I try to open that folder in Visual Studio Code, I get this in the Output window:

Downloading and configuring the .NET Core Debugger... Telemetry is: Enabled log : Restoring packages for /Users/rheckart/.vscode/extensions/ms-vscode.csharp-0.3.7/coreclr-debug/project.json... info : Committing restore... log : Lock file has not changed. Skipping lock file write. Path: /Users/rheckart/.vscode/extensions/ms-vscode.csharp-0.3.7/coreclr-debug/project.lock.json log : /Users/rheckart/.vscode/extensions/ms-vscode.csharp-0.3.7/coreclr-debug/project.json log : Restore completed in 632ms.

NuGet Config files used: /Users/rheckart/.vscode/extensions/ms-vscode.csharp-0.3.7/coreclr-debug/NuGet.config

Feeds used: https://www.myget.org/F/dotnet-core/api/v3/index.json https://api.nuget.org/v3/index.json https://www.myget.org/F/coreclr-debug/api/v3/index.json Telemetry is: Enabled Error: Can not find runtime target for framework 'DNXCore,Version=v5.0' compatible with one of the target runtimes: 'osx.10.11-x64'. Possible causes: 1. The project has not been restored or restore failed - run dotnet restore 2. The project does not list one of 'osx.10.11-x64' in the 'runtimes' section. Error:

System.InvalidOperationException: Can not find runtime target for framework 'DNXCore,Version=v5.0' compatible with one of the target runtimes: 'osx.10.11-x64'. Possible causes: 1. The project has not been restored or restore failed - run dotnet restore 2. The project does not list one of 'osx.10.11-x64' in the 'runtimes' section. at Microsoft.DotNet.ProjectModel.BuildWorkspace.GetRuntimeContext(ProjectContext context, IEnumerable1 runtimeIdentifiers) at System.Linq.Enumerable.WhereSelectListIterator2.MoveNext() at System.Collections.Generic.List1..ctor(IEnumerable1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) at Microsoft.DotNet.Tools.Publish.PublishCommand.TryPrepareForPublish()
at Microsoft.DotNet.Tools.Publish.PublishCommand.<>c__DisplayClass0_0.b__0() at Microsoft.DotNet.Cli.CommandLine.CommandLineApplication.Execute(String[] args) at Microsoft.DotNet.Tools.Publish.PublishCommand.Run(String[] args) dotnet exited with error code 1 Error while installing .NET Core Debugger.

I tried to do both steps 1 & 2, but I still get the same error. My project.json file looks like this:

{
  "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.0.0-rc2-3002702",
      "type": "platform"
    },
    "Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final",
    "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0-rc2-final",
    "Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final",
    "Microsoft.Extensions.Logging": "1.0.0-rc2-final",
    "Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final",
    "Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final"
  },

  "tools": {
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": {
      "version": "1.0.0-preview1-final",
      "imports": "portable-net45+win8+dnxcore50"
    }
  },

  "frameworks": {
    "netcoreapp1.0": {
      "imports": [
        "dotnet5.6",
        "dnxcore50",
        "portable-net45+win8"
      ]
    }
  },

  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true
  },

  "runtimeOptions": {
    "gcServer": true
  },

  "publishOptions": {
    "include": [
      "wwwroot",
      "Views",
      "appsettings.json",
      "web.config"
    ]
  },

  "scripts": {
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
  },

  "tooling": {
    "defaultNamespace": "rc2api"
  },
  "runtimes": {
      "osx.10.11-x64": { }
    }
}

If I try to run debug in VS Code using the .NET Core Launch (web), I get an error:

Debug adapter executable '/Users/rheckart/.vscode/extensions/ms-vscode.csharp-0.3.7/coreclr-debug/debugAdapters/OpenDebugAD7' not found.

Any ideas as to why this isn't working?

like image 552
Rob Avatar asked Dec 25 '22 05:12

Rob


1 Answers

I received the same error. For me, I noticed there was an update available for the VS Code C# extension (I saw the green circle on the icon in the lower-left). Once I installed the update (version 1.0.10) and restarted VS Code, the error went away and I got "Successfully installed .NET Core Debugger".

like image 167
Jason Avatar answered Jan 09 '23 15:01

Jason