Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dotnet run opens the wrong URL #460

Closed
inputusernamehere opened this issue Aug 4, 2021 · 5 comments · Fixed by #524
Closed

Dotnet run opens the wrong URL #460

inputusernamehere opened this issue Aug 4, 2021 · 5 comments · Fixed by #524

Comments

@inputusernamehere
Copy link

After creating a new project with the template, running the command dotnet run results in my browser opening a tab with the url http://0.0.0.0:8085/. However this is the backend's URL. Shouldn't it open the client instead, at :8080?

@theprash
Copy link
Member

theprash commented Aug 4, 2021

The template stopped automatically opening a browser tab a while back because it's annoying while working on a project when you already have the browser tab ready to go.

Do you use Visual Studio? It creates launchSettings.json with "launchBrowser": true. This then causes dotnet to launch the browser on run. I'm not sure how to correct the port here but you can at least change launchBrowser to false.

@inputusernamehere
Copy link
Author

Ahh must be the case yeah, I do indeed have a launchSettings.json file with "launchBrowser": true. Case solved. Maybe it would be better for the template to include a launcSettings.json where that setting is set to false?

@isaacabraham
Copy link
Member

@theprash I've seen this too. Either including a file that stops this happening, or including documentation to explain this, would be my suggestion.

@theprash
Copy link
Member

theprash commented Sep 5, 2022

I found a better fix for this issue than including a default file. You can add <NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile to Server.fsproj. I opened PR #523 to make this change to both default and minimal templates.

@theprash
Copy link
Member

theprash commented Sep 5, 2022

Actually cancel that (my last comment). If we remove the file then the environment is defaulted to Production while running in dev. So I've opened PR #524 to add launchSettings.json to the minimal template as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants