我已经在 Windows 中使用 Visual Studio 几年了,但刚刚开始在 Linux(Ubuntu 16)中切换到 Visual Code。
我按照 Microsoft dotnet 页面上的安装说明进行操作,甚至还观看了他们发布的视频教程。一切都安装好了,似乎运行良好。我创建了示例 hello world 应用程序并在 VS 终端中运行它,它运行正常,没有任何错误。但是当我添加一些代码进行调试时,它给出了错误 ..
Error: Debug adapter process has terminated unexpectedly ..
我已经安装了 C# 和所有其他需要的扩展以及 mono 等。
我是否遗漏了什么?
我不确定要发布有关错误什么信息,但扩展日志输出显示:
Failed to initialize CoreCLR, HRESULT: 0x80131500Failed to initialize CoreCLR, HRESULT: 0x80131500Failed to initialize CoreCLR, HRESULT: 0x80131500Failed to initialize CoreCLR, HRESULT: 0x80131500Failed to initialize CoreCLR, HRESULT: 0x80131500Failed to initialize CoreCLR, HRESULT: 0x80131500
OmniSharp Log 显示:
Starting OmniSharp server at 11/18/2016, 1:14:40 AM
Target: /home/dany/Documents/VisualCodeProjects/hwapp
OmniSharp server started wth Mono
Path: /home/dany/.vscode/extensions/ms-vscode.csharp-1.5.2/bin/run
PID: 15606
OmniSharp: -s /home/dany/Documents/VisualCodeProjects/hwapp --hostPID 15567 --stdio DotNet:enablePackageRestore=false --encoding utf-8
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Startup","Message":"Omnisharp server running using Stdio at location '/home/dany/Documents/VisualCodeProjects/hwapp' on host 15567."},"Seq":1,"Type":"event"}
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Initializing in /home/dany/Documents/VisualCodeProjects/hwapp
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Auto package restore: False
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Update workspace context
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Update project /home/dany/Documents/VisualCodeProjects/hwapp
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Add project /home/dany/Documents/VisualCodeProjects/hwapp/project.json => 1ab361c7-ef0a-46cf-9d9e-dc6a791377d5
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Resolving projects references
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Processing [ProjectState] hwapp/.NETCoreApp,Version=v1.1
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Added 73 and removed 0 file references
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Added 1 and removed 0 documents.
[INFORMATION:OmniSharp#MSBuild] No solution files found in '/home/dany/Documents/VisualCodeProjects/hwapp'
[INFORMATION:OmniSharp.Startup] Configuration finished.
答案1
我在装有 .NET Core 1.1(来自微软官方网站 www.microsoft.com/net/core)和 Visual Studio Code > = 1.7.0 的 Ubuntu 16.10 机器上遇到了完全相同的问题
安装最新的 C# 扩展 (1.6-beta3) 有帮助。请参阅: https://github.com/OmniSharp/omnisharp-vscode/wiki/Installing-Beta-Releases
执行“dotnet --info”:.NET 命令行工具(1.0.0-preview2-1-003177)
产品信息:版本:1.0.0-preview2-1-003177 提交 SHA-1 哈希:a2df9c2576
运行环境:操作系统名称:ubuntu 操作系统版本:16.10 操作系统平台:Linux RID:ubuntu.16.10-x64