【发布时间】:2016-09-14 02:51:43
【问题描述】:
我在 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 log : 恢复在 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 restore2. 该项目未在“运行时”部分列出“osx.10.11-x64”之一。错误:System.InvalidOperationException:找不到运行时目标 框架 'DNXCore,Version=v5.0' 与目标之一兼容 运行时:'osx.10.11-x64'。可能的原因: 1.项目没有恢复或恢复失败-运行
dotnet restore2. 该项目未在“运行时”部分列出“osx.10.11-x64”之一。在 Microsoft.DotNet.ProjectModel.BuildWorkspace.GetRuntimeContext(ProjectContext 上下文,IEnumerable1 runtimeIdentifiers) at System.Linq.Enumerable.WhereSelectListIterator2.MoveNext() 在 System.Collections.Generic.List1..ctor(IEnumerable1 个集合)
在 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(字符串 [] 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' 没找到。
关于为什么这不起作用的任何想法?
【问题讨论】:
标签: macos asp.net-core visual-studio-code omnisharp