When debugging in Visual Studio Code, is it possible to start my Angular SPA only after my dotnet API has initialized in my compound config statement?
My compound config below starts both (SPA and Dotnet) together, but in some cases, not all, the SPA starts up and finishes initializing before the dotnet API initializes and the SPA makes a call immediately to the db in the API on the home page. So in the cases where the SPA in done initializing but the API hasn't finished initializing I see an error like this below. So I have to refresh the browser once or twice until the dotnet API finishes initializing first.
It seems like the initialization of the two projects when debugging and which one finishes first is completely random?
Failed to load resource: net::ERR_CONNECTION_REFUSED [http://localhost:5001/api/matter/options]
Here is my compound config:
"compounds": [{
"name": "Server/Client",
"configurations": ["Dotnet", "Chrome"]
}],
"configurations": [{
"name": "Chrome",
"type": "chrome",
"request": "launch",
"url": "http://localhost:4200",
"webRoot": "${workspaceFolder}/Auto2-SPA"
}, {
"name": "Dotnet",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/Auto2.API/bin/Debug/netcoreapp2.2/Auto2.API.dll",
"args": [],
"cwd": "${workspaceFolder}/Auto2.API",
"stopAtEntry": false,
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
}]from Is it possible to start my angular SPA only after the dotnet api gets initialized in my launch.json file?
No comments:
Post a Comment