I am working on an ASPNET core web API application. When I try to debug the application, the "appsetting.json" file is not copied to the debug folder. At this moment I am copying this file whenever I made changes. If I did not copy the file and I just run the dotnet run
command, the application fails to load giving the file not found exception.
Should I do anything in the Launch.json file?
Here is what I have in mine.
I have also tried adding
"/appsettings.json":"${workspaceFolder}/appsettings.json"
in the "sourceFileMap"
property in this JSON file but no use.
Please help.
{
// 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, make sure to update the program path.
"program": "${workspaceFolder}/SmartAPI/bin/Debug/netcoreapp2.0/smartAPI.dll",
"args": [
],
"cwd": "${workspaceFolder}/SmartAPI",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart",
"launchBrowser": {
"enabled": true,
"args": "${auto-detect-url}",
"windows": {
"command": "cmd.exe",
"args": "/C start ${auto-detect-url}"
},
"osx": {
"command": "open"
},
"linux": {
"command": "xdg-open"
}
},
"requireExactSource": false,
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
}
]
}