MAUI Dev tunnel auto-detection

179 Views Asked by At

After Visual studio released Dev tunnels for easy debugging of e.g. localhost apis triggered from app running on real device, they made the whole mobile/webhook debugging experience better.

In .ASP NET Core you can use: Environment.GetEnvironmentVariable("VS_TUNNEL_URL") to automatically detect if you have DevTunnel turned on.

But is there a way how to auto-detect it from MAUI application ?

Because right now I had to create manual bool variable IsLocalVsTunnelTurnedOn based on which I choose the destination domain. Or is there another better way how to do this ?

0

There are 0 best solutions below