1.设置:我已经在我的 Ubuntu 上安装了 Visual Studio 代码并安装了.NET Core和 Mono。
2.初始配置:我创建了一个简单的演示应用程序运行notnet restore
和dotnet run
. 这可以正常工作并显示“Hello World!” 在终端上。
3.扩展:为了调试这个,我安装了OmniSharp的扩展。然后使用 Visual Studio Code 的“调试器”选项,我添加了launch.json和task.json。
4.launch.json(只显示配置部分):
....
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/bin/Debug/netstandardapp1.5/hwAppCore2.dll",
"args": [],
"cwd": "${workspaceRoot}",
"stopAtEntry": false
}
....
5.现在,当从终端运行时它工作正常,但是当尝试使用选项.NET Core Launch (console)进行调试时,我收到以下错误:
“启动:属性‘程序’无效。‘/home/ak/dotnet_core/hwAppCore2/bin/Debug/netstandardapp1.5/hwAppCore2.dll’是库 (.dll),而不是程序。”
我还关注了Channel 9 demo之一,在那里我还可以看到为 launch.json 的程序属性配置的hwapp.dll
我不确定,我是否缺少要配置的内容?