我的迁移层有一个 dotnet 7.0 c# 控制台项目,问题是我应该在对其进行一些更改时清理并构建我的项目。 如果我不这样做,我的更改就不会执行。
我在 Visual Studio 中尝试,它工作正常
在我的 launch.jason 文件和控制台项目配置中,我使用了
"preLaunchTask": "build"
并且我在我的 task.json 文件中为“build”添加了这个标签
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/Cooking.RestApi/Cooking.RestApi.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
}
如您所见,这是我的 RestApi 层,我为我的控制台应用程序创建了如下所示的新任务
{
"label": "build-migration",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/Cooking.Migrations/Cooking.Migrations.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
}
最后我把它放在我的 Lunch.jason 文件中,如下所示:
{
"name": "Migrations",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build-migration",
"program": "${workspaceFolder}/Cooking.Migrations/bin/Debug/net7.0/Cooking.Migrations.dll",
"args": [],
"cwd": "${workspaceFolder}/Cooking.Migrations",
"stopAtEntry": false,
"console": "internalConsole"
}