How to Host DNX,DNU,DotNet Core CR in IIS

Follow the steps below to host DXN based application in IIS.

1. Install URLReWrite IIS Module from this URL here

2. Install the HttpPlatformHandler v1.2 module in IIS, go to the Internet and search for it, then download it.
     - Restart IIS when it is installed
     - This handler acts as a middle man between IIS and DNX, IIS passes the traffic to the Handler, then that passes the traffic to DNX.
     - Remember DNX is the predecessor of Asp.Net Core

3. Add necessary (32 or 64-bit) DLL in either System32 or SystemWOW Folder. If your application consumes dll, it will look in those two folders.
    - Unlike .Net Core which looks in the Project folder first and then moves on to System Folders to see if DLL are available, DNX or DNU looks in System folders first.

4. If your application needs folders created, do so.
    - Create two folders and give IIS the necessary permission to access or write to those folders.
5. Make necessary changes to the application source code if needed.


About #DNX application

1. When you publish a DNX-based application, three folders are created, 
      1. approot
      2. logs
      3. wwwroot 

Troubleshooting
1. If you see IIS saying there is a bad module for HttpPlatform just go to the website, find Modules, then click on "Configure NativeModules
   then select httpPlatformHandler in the window that pops up.

Extra Notes
1. When you publish a DNX-based application the hosted folder can be found in the certificate folder in a Release folder. Based on how you indicated the publish path to be.


Write an Article
If you log in, you will be notified when someone leaves a comment.

Other users would like to know if this solution helped you.


© 2022 - ErnesTech - Privacy