我正在研究ASPNET核心Web API应用程序。当我尝试调试应用程序时,“ appsetting.json”文件未复制到调试文件夹。此刻,每当进行更改时,我都将复制此文件。如果我没有复制文件,而只是运行dotnet run命令,则应用程序加载失败,给文件未找到异常。
我应该在Launch.json文件中做什么吗?
这是我的东西。
我也尝试添加
"/appsettings.json":"${workspaceFolder}/appsettings.json"
Run Code Online (Sandbox Code Playgroud)
在"sourceFileMap"此JSON文件的属性中,但没有用。
请帮忙。
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "attach",
"name": "Attach to Chrome",
"port": 9222,
"webRoot": "${workspaceFolder}"
},
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, …Run Code Online (Sandbox Code Playgroud)