0

I used netstat -aon | findstr 28080 to check if the port is in use, and it returned nothing The command prompt But when I want to use this port in Asp.net, the error shows like following, the error shown in Visual Studio. Is there anyone encounter this before? I just want to know how can I grant my application access to this port.

I also tried 38080,48080,28081, none can work.

I am using the signalR to connect with the frontend, and the code where the exception occur is as following:

        string url = "HTTP://*:28080";
        using (WebApp.Start<Startup>(url))// Exception occurs here
        {
            Logger.Info($"SelfHosted Server running on {url}");
            Dosomething();
        }
tina
  • 31
  • 1
  • 6
  • Can you show some more code where the exception is thrown? And also, does it work by trying port 28081 for example? – JLe Nov 28 '18 at 07:42
  • See https://stackoverflow.com/questions/24976425/running-self-hosted-owin-web-api-under-non-admin-account, or start Visual Studio as Administrator. – JLe Nov 28 '18 at 10:19
  • Thank you! Running Visual Studio as Administrator solved this problem. – tina Nov 28 '18 at 22:57

0 Answers0