Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio code Don';I don’我不知道从哪里开始调试c#_Visual Studio Code - Fatal编程技术网

Visual studio code Don';I don’我不知道从哪里开始调试c#

Visual studio code Don';I don’我不知道从哪里开始调试c#,visual-studio-code,Visual Studio Code,我正在尝试用VisualStudio代码调试控制台应用程序。我已经尝试了很多事情来达到这一点,现在我不明白这意味着什么 ${workspaceRoot}/bin/Debug/<insert-target-framework-here>/<insert-project-name-here>.dll 作为“程序”的值 我知道${workspaceRoot}在哪里,但我不知道我的项目目标框架是什么,也不知道如何找到它,而且我的工作空间根目录中没有bin文件 以下是调试配置文件

我正在尝试用VisualStudio代码调试控制台应用程序。我已经尝试了很多事情来达到这一点,现在我不明白这意味着什么

${workspaceRoot}/bin/Debug/<insert-target-framework-here>/<insert-project-name-here>.dll
作为“程序”的值

我知道${workspaceRoot}在哪里,但我不知道我的项目目标框架是什么,也不知道如何找到它,而且我的工作空间根目录中没有bin文件

以下是调试配置文件:

"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/bin/Debug/<insert-target-framework-here>/<insert-project-name-here>.dll",
"args": [],
"cwd": "${workspaceRoot}",
"stopAtEntry": false,
"console": "internalConsole"
“名称”:“.NET核心启动(控制台)”,
“类型”:“coreclr”,
“请求”:“启动”,
“预启动任务”:“构建”,
“程序”:“${workspaceRoot}/bin/Debug/.dll”,
“args”:[],
“cwd”:“${workspaceRoot}”,
“stopAtEntry”:false,
“控制台”:“内部控制台”

您可以在project.json或.csproj中找到框架

参考:

如果在项目根目录中运行
dotnet restore&&dotnet build
。它将生成一个bin文件夹(如果您没有修改输出文件)


例如:我的名为Temp的项目有一个csproj,其值为
netcoreapp1.1
。我的
程序
值设置为
${workspaceRoot}\bin\Debug\netcoreapp1.1\Temp.dll

我也遇到了同样的问题,但我通过更改

"program": "${workspaceFolder}/bin/Debug/netcoreapp3.1/temp.dll",


.dll
文件名更改为项目文件名。就是这样。

你有什么问题?仅供参考,no
.dll
不是C程序。我在所有其他C#Visual studio代码调试教程中都看到了这一点。错误是什么?你有什么问题?您不知道为
目标框架
项目名称
添加什么吗?
"program": "${workspaceFolder}/bin/Debug/netcoreapp3.1/temp.dll",
"program": "${workspaceFolder}/bin/Debug/netcoreapp3.1/MyProject.dll",