-
Beta Was this translation helpful? Give feedback.
Replies: 12 comments 6 replies
-
Can you provide more information? What does the apphost code looks like? What do the launch settings look like for the failing projects? I see authApi has no endpoints, which makes me think there's something strange going on with the launchSettings.json for that project. |
Beta Was this translation helpful? Give feedback.
-
It's very likely you're running into this #225 |
Beta Was this translation helpful? Give feedback.
-
@davidfowl I also suspect it's launchSetting,json, I ad a new WeatherAPI and used WithServiceBinding() and it's working fine. My existing launchSettings.cs for authAPI is :
|
Beta Was this translation helpful? Give feedback.
-
It's trying to use the "IIS Express" profile and there's no application URL. You can specify the launch profile in your app host code using I'm not sure that we support launching IIS express (we especially don't from the command line) @BillHiebert ? |
Beta Was this translation helpful? Give feedback.
-
@davidfowl with iisexpress, the application url allow to specify the endpoint name : http://localhost:61060/Authentication |
Beta Was this translation helpful? Give feedback.
-
Your screenshot seems to show you starting two hosts in a single application, one using the new |
Beta Was this translation helpful? Give feedback.
-
@DamianEdwards Thanks, done, I refactor to use WebApplication.CreateBuilder throughout. But, I'm still struggling on getting the servicename on the url using launchSettings profiles : The endpoint is showing as http://localhost:5280/swagger Any insights will be much appreciated. |
Beta Was this translation helpful? Give feedback.
-
The {
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"http": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "Authentication/swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Local"
},
"dotnetRunMessages": true,
"applicationUrl": "http://localhost:5280/Authentication"
},
"https": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "Authentication/swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Local"
},
"dotnetRunMessages": true,
"applicationUrl": "https://localhost:7104/Authentication"
}
}
} |
Beta Was this translation helpful? Give feedback.
-
@DamianEdwards This indeed changes the url : But clicking on it doesn't load swagger : |
Beta Was this translation helpful? Give feedback.
-
This might be an issue with Swashbuckle itself not properly supporting |
Beta Was this translation helpful? Give feedback.
-
@DamianEdwards Thanks, it looks like it's a swagger registration problem. @davidfowl I see in the screenshot here, you have the servicename "Weather" in the url of the webapi endpoint, does it it load swagger when you click on the endpoint ? Would you share the code ? |
Beta Was this translation helpful? Give feedback.
-
What if I want to define a different port other than the one in the profile? |
Beta Was this translation helpful? Give feedback.
I was able to solve this using
app.UsePathBase("/Authentication");
while making my swagger setup agnostic :
"Authentication": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "Authentication/swagger",
"applicationUrl": "https://localhost:7104;http://localhost:5280",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Local"
}
}