I'm trying to debug the Azure function, but it exists with the error "Unknown argument debug".
Please find below the screenshot of the project debug configuration.
I have referred to this link.
When I run without --debug vs
, the application runs perfectly fine but I'm not able to hit the breakpoint.
I have tried host start --debug vs also, but it's also not working.
It gives the following exception.
I have solved the issue with the help of this link. In my case, it was the cases when the Windows username contained spaces.
Change the launchSettings.json file to something like this:
"newProfile1": {
"commandName": "Executable",
"executablePath": "C:\\Program Files\\dotnet\\dotnet.exe",
"commandLineArgs": "\"C:\\Users\\myname\\AppData\\Roaming\\npm\\node_modules\\azure-functions-core-tools\\bin\\Azure.Functions.Cli.dll\" host start",
"workingDirectory": "$(TargetDir)"
}