IIS Deployment Port Issue

I followed the manual build and deploy procedure. I set it to use outofprocess in the web.config. The site appears but does not function. Looking at the log, it appears that the asp.net core app is binding to a random port instead of the configured port (5000). If the app is run from the command line (dotnet server.dll), it runs and binds to the proper port. With this running, the site works. I haven’t been able to find why it doesn’t bind to the proper port when run from iis. Any help would be greatly appreciated.

Hi @Krickel2,

Unfortunately we haven't seen this behavior before and don't know why it could be happening.

The environment that I’m trying to run it on is Windows Server 2012R2 with IIS8.5. It has the latest version of the asp.net core and .net core runtimes (3.1.4, I believe). Is there possibly a add-on or module that I may have left out. I only installed the basics for IIS. I create an app under the default website. I built the angular using the —base-href option. I simply copied the radzen generated core app to the app directory and the angular to a wwwroot directory. I added the environment variable for the connection string. I change the web.config to outofprocess (defaults to in process and errors). I wasn’t sure if I missed a setting or something.

When a .NET Core app is deployed in IIS the latter is responsible for starting the process. The web site should work on the port the virtual directory is created (usually 80).

The frontend angular app comes up as expected on port 80 or 443 (ssl). IIS launches the backend process but it is listening on a random port instead of port 5000 as configured/expected. As a result, the angular database connection doesn't work (ex. Clicking on login button on login page doesn't do anything). If I manually start the backend from an admin command prompt, it starts and listens on the proper port (5000). The frontend will then work (ie I can log in and it works as expected). The puzzle is why does the IIS launched backend listen on a random port instead of the configured port (5000).

If you follow the official deployment procedure there should be only one IIS application - the .NET Core. It serves the angular files from its own wwwroot directory. Check step 4:

  1. Add the Angular app in wwwroot sub-folder of your .NET Core app.

I did that. When I follow the instructions, I get an error in the event log stating to the effect that it is running in the iis process but not designed to. I change the web.config from inprocess to outofprocess. The app will now come up but the login button won't work. Basically, it is not able to access the database.

When I look at the radzen log, it mentions listening on a port but it changes each time that the app restarts. I believe it should be starting on port 5000. If I start the server.dll (dotnet server.dll) manually from the command line, it states that it is listening on port 5000. What I can't figure out is why it is not port 5000 when I access the app from iis through the web browser.

It doesn't have to be port 5000 :slight_smile: You have missed this step. You have to set the url to the data sources e.g. from localhost:5000/odata/northwind to /odata/northwind.

That worked. Thanks. You might want to move that portion up in the documentation since I imagine that it is something you need to do before you build the angular portion for it to take effect. You might also want to add that you will need to include the virtual directory (i.e. if you used --base-href /foo/bar/, that would need to be included). One might assume that the --base-href might do it for you. Thanks again for the help. I figured I was missing something.