在VS代码中将.NET项目设置为StartUp,可以按照以下步骤进行操作:
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/bin/Debug/netcoreapp3.1/YourProjectName.dll",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
}
]
}
请注意,上述配置是基于.NET Core项目的,如果你使用的是其他版本的.NET,请相应地修改配置。
这样,你的.NET项目就被设置为StartUp了,你可以在VS代码中进行调试和运行。
领取专属 10元无门槛券
手把手带您无忧上云