我已经在OSX El Capitan(10.11.4)中安装了最新版本的Visual Studio Code(1.1.1)。我还安装了最新版本的Core RC2。dotnet --version给我1.0.0-preview1-002702。我读过的其中一个Web线程说要删除旧版本的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:正在进行还原...日志:锁定文件未更改。跳过锁定文件写入。路径:/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:找不到与目标运行时之一“ osx.10.11-x64”兼容的框架“ DNXCore,Version = v5.0”的运行时目标。可能的原因:1.项目尚未还原或还原失败-运行
dotnet restore
2.项目未在“运行时”部分列出“ osx.10.11-x64”之一。在Microsoft.DotNet.ProjectModel.BuildWorkspace.GetRuntimeContext(ProjectContext上下文,IEnumerable1 runtimeIdentifiers) at System.Linq.Enumerable.WhereSelectListIterator
2.MoveNext()在System.Collections.Generic.List1..ctor(IEnumerable
1集合)
在System.Linq.Enumerable.ToList [TSource](在Microsoft的IEnumerable`1源) .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退出,错误代码1安装.NET Core Debugger时出错。
我尝试同时执行步骤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'。
关于为什么这行不通的任何想法?
我收到了同样的错误。对我来说,我注意到VS Code C#扩展有可用的更新(我在左下角的图标上看到绿色的圆圈)。安装更新(版本1.0.10)并重新启动VS Code后,错误消失了,我得到了“成功安装.NET Core Debugger”的信息。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句