Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

How to use multiple debug launch profiles with Blazor?

$
0
0

My goal is to use multiple debug launch profiles and have multiple appsettings.json files with different Connection strings or Path variables.

I read the Microsoft docs on using multiple environments, found appsettings.Development.json in the folder structure and understand that the appsettings.Development.json is used when the project is started inside Visual Studio.

I have set up a Blazor Server App from VS project templates. Then tried to create a new debug launch profile via Project -> Properties -> Debug -> General -> Open debug launch profiles UI and named it devPK.

"profiles": {"https": {"commandName": "Project","launchBrowser": true,"environmentVariables": {"ASPNETCORE_ENVIRONMENT": "Development"    },"dotnetRunMessages": true,"applicationUrl": "https://localhost:7251;http://localhost:5262"  },"devPK": {"commandName": "Project","launchBrowser": true,"environmentVariables": {"ASPNETCORE_ENVIRONMENT": "DevelopmentPK"    },"dotnetRunMessages": true,"applicationUrl": "https://localhost:7251;http://localhost:5262"  }}

The only difference is the ASPNETCORE_ENVIRONMENT variable set to DevelopmentPK.Of course I placed a appsettings.DevelopmentPK.json file in the root folder.

When I start the project with the https launch profile the sample project looks just fine. When I start the project with the devPK launch profile the header and navigation are not shown, just the 'Body' with Hello, world!.

It seems that the MainLayout.razor is not loaded / used anymore.

Can anyone explain to me why this is happening and how to prevent it?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>