Visual Studio Angular App launching edge regardless of browser choice.

Mat Powers 21 Reputation points
2023-06-20T11:23:24.5966667+00:00

I'm following the tutorial here:

https://learn.microsoft.com/en-us/visualstudio/javascript/tutorial-asp-net-core-with-angular?source=recommendations&view=vs-2022

for the .Net core / Angular app (preview) and pressing Start (to debug) runs webapi.exe which force launches Edge to display the Angular front end, but then also launches chrome (system default and visual studio default) for the back end / swagger.

I've gone so far as to remove Edge from the list of browsers from visual studio and I've unchecked the "launch browser" options from the webapi project, but that only suppresses the swagger page being loaded in chrome. The webapi console still launches edge, and closing edge exits the webapi.

To be clear, the webapi is starting and opening a browser which navigates to the angular app, not the webapi.

There are no debug options within the AngularApp properties to be able to specify whether or not a browser launches.

It is possible to run the backend without running edge by going to the start button drop down and choosing "Browse With..." but this does not run in a full debug state as breakpoints are not hit.

How can I change the browser that this launches or suppress the browser entirely?

Thanks

Mat

Microsoft Edge
Microsoft Edge
A Microsoft cross-platform web browser that provides privacy, learning, and accessibility tools.
2,311 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,095 questions
0 comments No comments
{count} votes

Accepted answer
  1. Tianyu Sun-MSFT 30,561 Reputation points Microsoft Vendor
    2023-06-20T13:59:39.4633333+00:00

    Hello @Mat Powers ,

    Welcome to Microsoft Q&A forum.

    You may try a workaround currently:

    Right-click the angular app(not webapi) => select Set as Startup Project => Go to the Start button drop down => select Chrome or other browser for example localhost (Chrome) => click Start to run the project => stop debugging => Go to the Start button drop down => Configure Startup Projects… => Common Properties => Startup Project => select Multiple startup projects => Apply => OK => click Start to run your project again => check if it starts with correct web browser.

    Sincerely,

    Tianyu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    7 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.