Open cliedeman opened 5 months ago
You could use the DevTunnels feature in VS?
I'm also hitting this issue. My linux box is joined to my tailscale tailnet, I want all the services to bind to 0.0.0.0 not localhost or 127.0.0.1 to permit correct routing over the talent. This works fine in a non-aspire .NET Core webapp by editing the http launch scheme replacing localhost with 0.0.0.0. In an empty aspire app with just the AppHost and ServiceDefaults projects, doing this for AppHost's launch profile:
"http": { "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": true, "applicationUrl": "http://0.0.0.0:15061", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development", "DOTNET_ENVIRONMENT": "Development", "DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "http://0.0.0.0:19281", "DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "http://0.0.0.0:20198" } }
results in:
dotnetaspire dotnet run -lp http --project dotnetaspire.AppHost/dotnetaspire.AppHost.csproj
Building...
Unhandled exception. System.AggregateException: One or more errors occurred. (DOTNET_RESOURCE_SERVICE_ENDPOINT_U
RL must contain a local loopback address.)
---> System.ArgumentException: DOTNET_RESOURCE_SERVICE_ENDPOINT_URL must contain a local loopback address.
at Aspire.Hosting.Dashboard.DashboardServiceHost.<>c__DisplayClass4_0.<.ctor>g_ConfigureKestrel|0(KestrelSer
verOptions kestrelOptions) in //src/Aspire.Hosting/Dashboard/DashboardServiceHost.cs:line 158
at Microsoft.Extensions.Options.OptionsFactory1.Create(String name) at Microsoft.Extensions.Options.UnnamedOptionsManager
1.get_Value()
at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.CreateServiceContext(IOptions1 options, ILogge rFactory loggerFactory, DiagnosticSource diagnosticSource, KestrelMetrics metrics) at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl..ctor(IOptions
1 options, IEnumerable1 transpo rtFactories, IEnumerable
1 multiplexedFactories, IHttpsConfigurationService httpsConfigurationService, ILoggerFa
ctory loggerFactory, KestrelMetrics metrics)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void* arguments, Signature sig, Boolean isConstruc
tor)
at System.Reflection.MethodBaseInvoker.InvokeWithManyArgs(Object obj, BindingFlags invokeAttr, Binder binder,
[aspire] 0:[tmux]
which is a showstopper for my use case.
We are currently trying to figure out how Aspire interacts with these various tunneling and VPN services. You can see some experimentation that I've done here around DevTunnels (#4771).
You could potentially take a similar approach by using the Tailscale CLI to spin up a reverse proxy to expose the .NET project to your tailnet.
@mitchdenny dev tunnels should probably get its own ticket. In my case it was a physical device connected to my laptop that I was testing with. So the tunnel based solutions don't apply
Ciaran
There already is ;)
@glennc fyi as we were discussing recently
I am testing a setup where I need a service to be exposed outside of localhost on other network interfaces.
launchSettings.json
AppHost/Program.cs
If I launch the app directly (without aspire) I can access it on non localhost ips but when launching with App host I can't access Project1 exception on localhost.