//Setup local IP\
string localIP = LocalIPAddress();
app.Urls.Add("http://" + localIP + ":5072");
app.Urls.Add("https://" + localIP + ":7072");
app.Run();
static string LocalIPAddress() {
using (Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, 0)) {
socket.Connect("8.8.8.8", 65530);
IPEndPoint? endPoint = socket.LocalEndPoint as IPEndPoint;
if (endPoint != null) {
return endPoint.Address.ToString();
} else {
return "127.0.0.1";
}
}
}
Somehow through the many, many, many trial and errors of literal head pounding- the issue was not networking at all, but the web builder not knowing to accept data from localIP, which I had to find & build a function to "most accurately" get. Now Asp.Net 6 minimal API can be found on other devices easily.