An attempt was made to access a socket in a way forbidden by its access permissions. Why?
Most likely the socket is held by some process. Use netstat -o
to find which one.
An attempt was made to access a socket in a way forbidden by its access permissions (Bottle) (Python)
Does this problem go away when you try port 8000 instead of 80?
You're trying to bind to port 80. I don't know Windows, but on Linux your code would fail because port 80 (like all ports below 1024) is privileged--only root can bind to them. That's why you'll see most tutorials and web framework defaults use a high port number, typically 8000
or 8080
.
References:
https://www.w3.org/Daemon/User/Installation/PrivilegedPorts.html
https://en.wikipedia.org/wiki/Registered_port
dotnet core 3.1 IIS Error An attempt was made to access a socket in a way forbidden by its access permissions (10013)
Finally I found my solution on my own. I removed UseKestrel() line from program.cs and everything's good.
var config = new ConfigurationBuilder().AddCommandLine(args).Build();
return Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
webBuilder.UseKestrel(); **//remove this line.**
webBuilder.UseUrls();
webBuilder.UseIISIntegration();
}).ConfigureServices((context, services) =>
{
services.AddHostedService<Worker>();
services.AddHostedService<MonitorWorker>();
services.AddHostedService<TransferWorker>();
});
}
Related Topics
What Are the Limitations of SQLdependency
Make Listview.Scrollintoview Scroll the Item into the Center of the Listview (C#)
Linq to SQL Using Group by and Count(Distinct)
Getting/Setting File Owner in C#
Configure JSON.Net to Ignore Datacontract/Datamember Attributes
How to Find the Difference Between Two Images
Inno Setup for Windows Service
Using Itextsharp to Extract and Update Links in an Existing PDF
Why Can't I Use System.Io.File Methods in an MVC Controller
Just What Is an Intptr Exactly
How to Check If Tcpclient Connection Is Closed
Retrieve Credentials from Windows Credentials Store Using C#
C# Base64 String to Jpeg Image
How to Invoke a UI Method from Another Thread
"There Was an Error Running the Selected Code Generator" in VS 2013 Scaffolding
Removing Nodes from an Xmldocument