PhoenixDev
PhoenixDev

Reputation: 802

Force Visual Studio 2022 to NOT use proxy

Is there a way to configure VS2022 to not use the system proxy but connect directly to the internet?

Using VS2022 with Windows 10.

Upvotes: 3

Views: 4749

Answers (2)

bh_earth0
bh_earth0

Reputation: 2834

i also needed to do this. because vs2022 cound not download nuget packages.

how to:

  1. win+R -> inetcpl.exe -> ENTER
  2. goto CONNECTIONS Tab. press "Lan Settings" Button
    • disable proxy Auto Detect
    • disable use a proxy server ..... - UnCheck ALL
  3. Restart vs2022.

photo tutorial:

enter image description here

enter image description here


if you are changing proxy settings, frequetly. you might wanna do it with batch file.

do it via CMD - programatically.

  • paste this code into notepad.save it.

  • rename as proxyOFF.bat

  • then RUN bat file.

  • restart vs2022.exe

ProxyOFF.bat

echo Switching OFF proxy . . .
echo.
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 0 /f
rem proxy: auto detect = off
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v AutoDetect /t REG_DWORD /d 0 /f
rem set filename="Proxy OFF.bat"
echo. 
echo Proxy:OFF -  AutoDetect:OFF
echo. 

REM press any key to exit......remove pause. if you dont want it..
@pause 

Upvotes: 1

user1728297
user1728297

Reputation: 31

Edit the devenv.exe.config file here C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE

and add the defaultProxy element as below in the System.Net block:

   <system.net>
        <defaultProxy enabled="false"></defaultProxy>
      <settings>
        <ipv6 enabled="true"/>
      </settings>
</system.net>

On a fresh install of VS 2022 Professional, package retrievals via Nuget were causing a Proxy authentication dialog to appear. Adding the above, and restarting VS solved the problem for me

Upvotes: 3

Related Questions