chore: 添加项目配置文件和VS Code调试配置

添加global.json设置.NET SDK版本
添加VS Code的launch.json和tasks.json调试配置
This commit is contained in:
赵正易 2026-01-23 09:38:16 +08:00
parent e09908954e
commit a98affad82
3 changed files with 82 additions and 0 deletions

35
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,35 @@
{
"version": "0.2.0",
"configurations": [
{
// 使 IntelliSense C#
//
// 访 https://github.com/dotnet/vscode-csharp/blob/main/debugger-launchjson.md
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
//
"program": "${workspaceFolder}/ZR.Admin.WebApi/bin/Debug/net7.0/ZR.Admin.WebApi.dll",
"args": [],
"cwd": "${workspaceFolder}/ZR.Admin.WebApi",
"stopAtEntry": false,
// ASP.NET Core Web : https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
}

41
.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,41 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/ZR.Admin.WebApi/ZR.Admin.WebApi.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/ZR.Admin.WebApi/ZR.Admin.WebApi.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/ZR.Admin.WebApi/ZR.Admin.WebApi.csproj"
],
"problemMatcher": "$msCompile"
}
]
}

6
global.json Normal file
View File

@ -0,0 +1,6 @@
{
"sdk": {
"version": "7.0.410",
"rollForward": "latestFeature"
}
}