Reputation: 2129
Is there a way to tell Visual Studio 2022 which Edge profile to launch when debugging a docker app?
They seem to have removed the "Browse With" option that let you define a new browser with parameters and only allow you select Edge, Chrome, Firefox, etc. with not parameters.
My default profile is "Work", which uses the new Edge for business but Visual Studio keeps launching my personal profile. This is problematic as all my saved passwords that I need to use when debugging are in the "Work" profile.
Upvotes: 4
Views: 1617
Reputation: 2585
I tried both existing answers to no avail. Neither used my default profile. I tried using both arguments together (--profile-directory
and --user-data-dir
). While this did appear to launch the browser with my profile, VS gave an error message, and the browser never navigated away from about:blank
.
As a compromise, I copied my default profile (find the path for it at edge://profile-internals
) to the one that VS uses. This copied most (but not all) of the settings that annoyed me about the MS Edge VS profile, and I was able to further adjust in settings to my liking.
Upvotes: 0
Reputation: 1662
Elin's answer will launch the browser with the default profile. However, if your goal is to launch in a specific profile, then you should use the --profile-directory
argument.
You can find the profile directory for any profile using the PowerShell snippet below. It will list all Edge profiles by profile name and folder name.
$EdgeProfiles = gci "$env:LOCALAPPDATA\Microsoft\Edge\User Data\" -Filter "Profile*"
ForEach($EdgeProfile in $EdgeProfiles.Name) {
$Preferences = "$env:LOCALAPPDATA\Microsoft\Edge\User Data\$EdgeProfile\Preferences"
$Data = (ConvertFrom-Json (Get-content $Preferences -Raw))
$profileName = $Data.Profile.Name
"$profileName,$EdgeProfile"
}
Then the argument textbox in Visual Studio would contain this text:
--profile-directory="Profile 4"
assuming that the profile you wish the launch with is in the Profile 4
folder.
Upvotes: 4
Reputation: 131
Which type of project are you debugging?
To configure Visual Studio to launch the browser with your 'work' profile you'll need to:
C:\Program Files (x86)\Microsoft\Edge Beta\Application\msedge.exe --user-data-dir="C:\Users\AppData\local\Microsoft\Edge Beta\User Data"
Upvotes: 6