Having an issue with Owin (pretty new to this).
Basically, we have a windows desktop application which runs Owin and listens for requests on
static string baseAddress = "https://+:4443/";
_server = WebApp.Start<Startup>(url: baseAddress);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
using (ProcessIcon pi = new ProcessIcon())
{
pi.Display();
// Make sure the application runs!
Application.Run();
}
The application runs on start up and is always listening.. all working great.
The issue is when "Switch User" happens. When the new user logs in they are presented with
Failed to listen on prefix 'https://+:4443/' because it conflicts with an existing registration on the machine.
I understand the reason why this is occurring, however, struggling to find a nice solution to resolve this without it getting messy detecting events etc.. Has anyone else experienced this?
Well, if the user needs to interact with the application it is user-bound. So, in your case a service wouldn't be applicable, well; for the user interaction part.
The problem here is that the port is already in use by the first user that sign in. Because the application is still running, a new user that starts the application will encounter this problem
If you are hosting a web-application, you have a couple of options: