Search code examples
c#asp.net-corevisual-studio-mac

Asp.net core 2.0 Error -13 EACCES permission denied


I have asp.net core 2.0 application run it under vs for mac, when i run it from CLI its work without any problem, but when I run it from VS I receive this error:

"Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking.UvException Error -13 EACCES permission denied

but after run this command in CLI

dotnet add package Microsoft.AspNetCore.Server.Kestrel

the Error became System.Net.Sockets.SocketException "Permission denied"

public class Program
{
    public static void Main(string[] args)
    {
        BuildWebHost(args).Run();//Error occur here
    }

    public static IWebHost BuildWebHost(string[] args) =>
    WebHost.CreateDefaultBuilder(args)
    .UseKestrel()
    .UseIISIntegration()
    .UseStartup<Startup>()
    .Build();
}

How i can solve this issue?


Solution

  • thank you

    the problem solved

    the problem was I should run VS for mac as admin by this command on terminal

    sudo /Applications/Visual\ Studio.app