0
I have a working project which the publication preference is in the format of publish to self hosted folder (selfhosted) (without using IIS). Reason for this: the goal is to decrease the work/knowledge of who will deploy, not needing to configure anything but copy, paste and run .exe. In this format, the publication generates in a Publish folder all the necessary files and one . exe, which when running raises the service. as shown in the following image:
Note: On the same server has IIS hosting two other sites made with Asp . net framework, even already using port 80 in both, but each with its different hostname. example: one is demo.nossosite.com.br on *:80 and the other is dev.nossosite.com.br on *:80.
It is important to note that for the operation of the new site (done in Asp .net core selfhosted) according to the previous image, it was only possible after stopping the two sites that used port 80. With the two sites working in an attempt to lift the new, an error occurs as per image:
"crit: Microsoft.AspNetCore.Server.Kestrel[0] Unable to start Kestrel. System.Net.Sockets.Socketexception (10013): An attempt to access a socket in a way that is prohibited by access permissions."
In IIS, in the list of Sites, right click on any site, option "Associations", it is possible to make the configuration of which hostname along with the port pointed to that particular site selected.
I believe the problem I am facing is related to this lack of hostname configuration. Means I’ve tried before:
- In launchSettings.json attributo applicationUrl where they had localhost quotes I switched to.nossosite.com.br
- In appsettings.json attributo Allowedhosts where I had only one "*" I switched to "sitenovo.nossosite.com.br"
- In Program.Cs in the Createhostbuilder method using . Useurls() stating the corresponding urls.
It seems that no one has the same effect as the configuration of Associations made in the IIS cited above. Before you tell me: just change the door to another door, for our scenario is unviable, we need it to be at door 80. Does anyone know how to solve this/has already experienced this problem of needing to keep websites hosted on IIS and at the same time self hosted?
Are you sure the two apps weren’t on different routes? For example, "http://dev.nossosite.com.br:80/app1/xxxx" and "http://dev.nossosite.com.br:80/app2/xxxx"?
– user131248