[英]How can I configure Visual Studio Code to run/debug .NET (dotnet) Core from the Windows Subsystem for Linux (WSL)?
[英]Visual Studio Code: How to configure 'dotnet' not to show warnings when compiling
好的。 我在 .NET Core 中并在 Mac 机器上使用 Visual Studio Code。 现在,每当我运行 C# 项目时,Visual Studio Code 都会显示这条烦人的消息:
启动前任务“构建”以退出代码 1 终止
它向我展示了单击名为“显示问题”的按钮的选项。 当我单击此按钮时,它仅显示警告消息。
现在,如果是错误,则可以看到此消息。 但事实上,每次有警告时它都会显示这条消息(对我来说是可以的)。 这很烦人。 有没有办法可以配置 Visual Studio Code 来不在警告之类的内容上显示这些消息?
您的task.json
文件可能有问题。 检查文件的参数并确保构建指向正确的位置:
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/MyProject.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
为了禁用警告,您应该将-nowarn
添加到tasks.json
文件中的args
:
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/MyProject.csproj",
"-nowarn" // here
],
"problemMatcher": "$msCompile"
}
]
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.