How to Install and use UniversalDashboard.Community with IIS

Dear All,

Am writing below instructions to help out anyone who is having difficulties using UniversalDashboard with IIS.

In this example am using Microsoft Windows Server 2016 or 2019 to leverage HTTP2, same steps will also work on previews versions of windows but you will be using HTTP1 protocol instead.

let us begin…

1- install your preferred version of Microsoft Windows Server (going to use 2019 in this example)

2- Follow instruction in the following link to install IIS using Server Manager

3- Make sure to install WebSocket protocol during the installation of IIS

image

4- Install ASP.NET Core Runtime 3.1.0 Hosting Bundle for Windows from the following link

image

5 - Install UniversalDashboard.Community from below link using powershell gallery

6- Create a website in IIS and configure the AppPool with an account with privileges

7- copy UniversalDashbard.community module contents(e.g C:\Program Files\WindowsPowerShell\Modules\UniversalDashboard.Community\2.8.1) into the root folder of your website created in previews step.

8- At the Root of the created website create a file named dashboard.ps1 and copy below code into it and save it

Start-UDDashboard -Port 80 -Wait -Dashboard (
    New-UDDashboard -Title "Powershell UniversalDashboard" -Content {
        New-UDButton -Id "test" -Text "test" -BackgroundColor "#6f42c1" -onClick {}
       
        
    }
)

9- launch your website and you should see a demo dashboard which an indication of a successful installation.

All done…

Note: its very important to use steps above as listed, for example if you install ASP.NET Core Runtime 3.1.0 before IIS you will end up with an error when you are done and in this case you need to reinstall ASP.NET Core Runtime 3.1.0 after you complete IIS installation steps.

Happy Coding…

5 Likes

hey @wsl2001
I created this to assist in the step to get the module to IIS root folder:

After updating to .NET Core Runtime 3.1.3 Hosting Bundle from 2.2.8 i needed to change my web.config file to load the new AspNetCoreModuleV2 instead of the old AspNetCoreModule since the old module cannot be found in the new hosting bundle.
Edit: I should possibly point out that I had removed all old versions of the .NET Core Runtime (Hosting Bundle), so it was not possible that IIS/UniversalDashboard use an older version.
Edit2: The ‘HTTP Error 500.21 - Internal Server Error’ i got after loading the Website was Handler “aspNetCore” has a bad module “AspNetCoreModule” in its module list


@adam

But this brings me to the question why we have been using the “old” .NET core module?
I am not really familiar with this, sorry if the question is a little strange.
The new module is available since version 2.2. See the difference for the module name in the documentation from version 2.1 to version 2.2
Starting with version 3.1, support for the old version is probably gone.


My dashboard is running fine and it feels a little faster.
(Also using pwsh (Version 7) instead of the old powershell 5.1)

You need to change:

FROM

<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />

TO

<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />

Take also a look at the official documentation ASP.NET Core Module - Configuration with web.config


Also the installation of the 3.1 Hosting Bundle is documented here: Install the .NET Core Hosting Bundle

After installing the 3.1 version in needed to stop the windows processactivation service (was) and restart the IIS to publish the new module:

net stop was /y
net start w3svc

No official support for 3.1
stay on 2.1.17 (or what every version is relevent of the time you read this.) (it’s the last LTS version on 2.1)

Ah, that explains the whole error message I get since the update to 3.1 :wink:
Then I go back to an older version (2.1.17 for now).
I think it is worth mentioning that the currently supported version 2.1 is the currently supported version.

@wsl2001 You should update your documentation in the first post to the following link for .NET Core: https://dotnet.microsoft.com/download/dotnet-core/2.1

well to be fair, the official point to the 2.2.8 version. NOT 3.1 :slight_smile:
I did yesterday point this out to Adam. I guess he will be focusing on the v3 documentation, and I guess he will correct the link to a “more” correct version :slight_smile:

1 Like

Exactly, that’s why I thought I would test the 3.1, because 2.2.8 is End Of Life. :slight_smile:
So i will take the 2.1.17 for now.