Skip to content

DevProxy not intercepting localhost requests when api is launched from Visual Studio 2022 #1403

@neil-thompson-schemeserve

Description

It's not clear to me how to get devProxy to intercept localhost requests when debug session launched from Visual Studio 2022 Pro. Requests made to https://jsonplaceholder.typicode.com are intercepted fine.

I have an asp net core web api that will launch on localhost:60309, and a sample ping endpoint

GET https://localhost:60309/ss/ping

I launch devproxy with a config file, which includes the port, an ExecutionSummaryPlugin and a reporter (all fine for jsonplaceholder.typicode.com)

"urlsToWatch": [
     "https://jsonplaceholder.typicode.com/*",
     "https://localhost:60309/*"
  ],

I've updated VS through the "Browse with..." dialog to Add a new browser,
FriendlyName: "EdgeProxy"
Program: "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"
Arguments: --proxy-bypass-list="<-loopback> --proxy-server="127.0.0.1:8000"`

I make sure no instance of edge is running. Click the Debug option in VS, choosing "EdgeProxy", which launches msedge with the API running - but devProxy never intercepts any requests to GET https://localhost:60309/ss/ping (made via a VSCode .http and from Postman)

Where am I going wrong?
I have tried variants of using the build in server. IISExpress, Debug, "Start without Debugging" - no variant has the proxy.

I have also tried just starting edge using Run: msedge --proxy-bypass-list="<-loopback> --proxy-server="127.0.0.1:8000
The choosing Edge as the browser in VS, which launches the app in a new tab of the browser launched from Run. Doesn't intercept.

Windows 11, all up to date. Any suggestions welcome.
A walkthrough would be amazing, if anyone else has got this to work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions