我已经在 OSX El Capitan (10.11.4) 中安装了最新版本的 Visual Studio Code (1.1.1)。我还安装了最新版本的 Core RC2。dotnet --version给了我1.0.0-preview1-002702。我阅读的其中一个网络线程说要删除旧版本的 OmniSharp 并安装最新版本,我这样做了。我还通过 Brew 安装了 OpenSSL。
当我为 aspnet 安装了最新的 yo 生成器并创建了一个示例应用程序时,它运行良好。当我尝试在 Visual Studio Code 中打开该文件夹时,我在“输出”窗口中得到了这个:
正在下载和配置 .NET Core 调试器...遥测是:已启用日志:正在恢复 /Users/rheckart/.vscode/extensions/ms-vscode.csharp-0.3.7/coreclr-debug/project.json 的包... info : 提交还原... log : 锁定文件未更改。跳过锁定文件写入。路径:/Users/rheckart/.vscode/extensions/ms-vscode.csharp-0.3.7/coreclr-debug/project.lock.json 日志:/Users/rheckart/.vscode/extensions/ms-vscode.csharp-0.3 .7/coreclr-debug/project.json 日志:恢复在 632 毫秒内完成。
使用的 NuGet 配置文件:/Users/rheckart/.vscode/extensions/ms-vscode.csharp-0.3.7/coreclr-debug/NuGet.config
使用的提要: 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遥测是:已启用错误:找不到与目标运行时之一兼容的框架“DNXCore,Version = v5.0”的运行时目标:“osx.10.11-x64” '。可能的原因: 1. 项目尚未恢复或恢复失败 - 运行
dotnet restore
2. 项目未在“运行时”部分列出“osx.10.11-x64”之一。错误:System.InvalidOperationException:找不到与目标运行时之一兼容的框架“DNXCore,Version = v5.0”的运行时目标:“osx.10.11-x64”。可能的原因: 1. 项目尚未恢复或恢复失败 - 运行
dotnet restore
2. 项目未在“运行时”部分列出“osx.10.11-x64”之一。在 Microsoft.DotNet.ProjectModel.BuildWorkspace.GetRuntimeContext(ProjectContext context, IEnumerable1 runtimeIdentifiers) at System.Linq.Enumerable.WhereSelectListIterator
2.MoveNext() 在 System.Collections.Generic.List1..ctor(IEnumerable
1 集合)
在 System.Linq.Enumerable.ToList[TSource](IEnumerable`1 源) 在 Microsoft .DotNet.Tools.Publish.PublishCommand.TryPrepareForPublish()
在 Microsoft.DotNet.Tools.Publish.PublishCommand.<>c__DisplayClass0_0.b__0() 在 Microsoft.DotNet.Cli.CommandLine.CommandLineApplication.Execute(String[] args) 在 Microsoft.DotNet.Tools.Publish.PublishCommand.Run(String [] args) dotnet exited with error code 1 安装 .NET Core 调试器时出错。
我尝试执行第 1 步和第 2 步,但仍然遇到相同的错误。我的 project.json 文件如下所示:
{
"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": { }
}
}
如果我尝试使用.NET Core Launch (web)在 VS Code 中运行调试,则会收到错误消息:
找不到调试适配器可执行文件“/Users/rheckart/.vscode/extensions/ms-vscode.csharp-0.3.7/coreclr-debug/debugAdapters/OpenDebugAD7”。
关于为什么这不起作用的任何想法?