elou
Posts: 96
Joined: Tue Apr 14, 2015 9:12 am

.NET Core Hosting Bundle with IIS

Hello,
I have a package which requier IIS and the .NET Core Hosting Bundle.
When I set the .NET Core Hosting Bundle as prerequisit and activate IIS as windows features all seams to be correctly installed.

The 'aspNetCore' handler in web.config can't be found and the web site do not started.

The reason why is that on fresh systems, IIS will be installed after the .NET Core Hosting Bundle.
As it is specified hier: https://docs.microsoft.com/en-us/aspnet ... ing-bundle the bundle have to be installed after IIS!
Important

If the Hosting Bundle is installed before IIS, the bundle installation must be repaired. Run the Hosting Bundle installer again after installing IIS.

If the Hosting Bundle is installed after installing the 64-bit (x64) version of .NET Core, SDKs might appear to be missing (No .NET Core SDKs were detected). To resolve the problem, see Troubleshoot and debug ASP.NET Core projects.
  1. Is it possible in AI to specify the instalation order? First IIS than .NET Core Hosting Bundle.
  2. I thing this should also be the default order that AI implements.
Regards,
Éric.
Catalin
Posts: 6582
Joined: Wed Jun 13, 2018 7:49 am

Re: .NET Core Hosting Bundle with IIS

Hello Éric,

Normally, it would be possible to specify the order of prerequisite's installations. For instance, the installation order is the same as you schedule them in the "Prerequisites" page.

However, your scenario is different. Here we are talking about a pre-install prerequisite which is installed even before the MSI is launched (by the .EXE bootstrapper) and a Windows feature, which is configured during the "Install Execution Stage" --> "Preparing" action group, on deferred stage.

As you can see, a pre-install prerequisite and a Windows feature are configured at a completely different point in time.

A solution here would be to use a custom action that enables IIS before the installation of ".NET Core IIS Hosting" prerequisite. For instance, you can add your custom action as a custom action without sequence (so it can be triggered from a UI control) and then schedule it in the "Dialogs" page --> "Pre-install UI" --> "WelcomePrereqDlg" dialog --> "Next" button.

This way, the IIS will be enabled before the prerequisite is installed.

One thing to keep in mind here is that the process must run with elevated privileges (as administrator) so the IIS feature can be enabled.

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
HienHo
Posts: 13
Joined: Thu Feb 25, 2021 6:46 am

Re: .NET Core Hosting Bundle with IIS

Hi Catalin,

Could you please confirm if the below workaround is still applicable for the latest AI version 18.0? Thanks.

Regards,
Hien
Catalin
Posts: 6582
Joined: Wed Jun 13, 2018 7:49 am

Re: .NET Core Hosting Bundle with IIS

Hello Hien and welcome to our forums,

This should work with the latest version of Advanced Installer as well, yes.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
HienHo
Posts: 13
Joined: Thu Feb 25, 2021 6:46 am

Re: .NET Core Hosting Bundle with IIS

Hi Catalin,

Thank you for your confirm.

So, in regards to creating a custom action that enables IIS and without sequence, would you mind shedding some light on how to achieve that from within AI please? I could see from the 'New Custom Action' wizard with predefined options, but I wasn't sure what to do there...
Thank you.

Regards,
Hien
Catalin
Posts: 6582
Joined: Wed Jun 13, 2018 7:49 am

Re: .NET Core Hosting Bundle with IIS

Hello Hien,

First thing we need to know here is the type of custom action you want to use, depending on the comfort level you have with each language (e.g. VBScript, PowerShell, C#).

For the sake of the sample, let's consider you develop your custom action in PowerShell. Here would be the steps:

- go to "Custom Actions" page

- add a PowerShell custom action, without sequence (so we can schedule it on our dialog)

WithoutSequence.png
WithoutSequence.png (11.24 KiB) Viewed 42922 times

- write the code required to achieve your requirement

- go to "Dialogs" page

- select your dialog

- click on the "Next" button

- under "Published Events" add a new "Execute custom action" event having as the argument your custom action

ExecuteCA.png
ExecuteCA.png (132.96 KiB) Viewed 42922 times

This way, when the "Next" button is pushed, the custom action will execute.

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
HienHo
Posts: 13
Joined: Thu Feb 25, 2021 6:46 am

Re: .NET Core Hosting Bundle with IIS

Hi Catalin,

Thanks a lot for your instructions Catalin! It worked like a charm.

Regards,
Hien
Catalin
Posts: 6582
Joined: Wed Jun 13, 2018 7:49 am

Re: .NET Core Hosting Bundle with IIS

You are always welcome, Hien!

I am really glad to hear everything worked as expected.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
elou
Posts: 96
Joined: Tue Apr 14, 2015 9:12 am

Re: .NET Core Hosting Bundle with IIS

Hello,
I have another question, could this solution also works with Headless installation?
I'd like to make it possible to use this setup in a container and do not have any GUI.

Regards,
Éric.
Catalin
Posts: 6582
Joined: Wed Jun 13, 2018 7:49 am

Re: .NET Core Hosting Bundle with IIS

Hello Éric,

As you can see above, the workaround requires the dialogs displayed by our .EXE in order to trigger the custom action that enables the IIS feature.

Without the dialogs, there would be no way to trigger the custom action, therefore I'm afraid this might not work.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”