In my ASP.NET Core 3.1
application, I need to set the query string parameter right from the launch of the application. But when I set an applicationUrl
having query string parameter in launchsettings.json
file, application fails to start.
You can see that, the application URL box is turned yellow and Visual Studio does not allow me to save !
If I open the launchsettings.json
in the text editor, set this URL and save the file, I get following error while running the application from Visual Studio. I get the following error:
Can someone explain, 1. Why it's not possible? 2. What's the solution? 3. What's ASP.NET Core's way of passing some values during start of the session?
Note: I need to pass TPAId while launching the application because my app is one of the many other enterprise applications and that's somehow forcing me to do this.
In your launchSettings.json
file, under your Profiles, you can add a launchUrl
property.
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "?TPAId=876894",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With