Skip to main content

DNN · Installation

This guide builds the static piece of the DNN recipe: the minimal DesktopModule that persists encrypted credentials and resolves the API URL. The nightly sync and the widget embed live in dedicated pages (see links at the end).

Requirements

ComponentMinimum
DNN Platform9.x
.NET Framework4.7.2+ (alternative: .NET 8)
SQL Server2016 SP1+
PermissionsHost (for HostSettings and Host → Schedule)

NuGet packages to reference in the module:

<PackageReference Include="Polly" Version="8.*" />
<PackageReference Include="System.Net.Http.Json" Version="6.*" />
<PackageReference Include="System.Text.Json" Version="6.*" />

Create the DesktopModule

Minimum structure inside DesktopModules/Neuroon/:

Neuroon/
├── App_Code/Neuroon/
│ ├── NeuroonSettings.cs
│ ├── NeuroonClient.cs
│ ├── NeuroonProduct.cs
│ └── WidgetTokenProvider.cs
├── Module.dnn // minimal manifest
├── ModuleSettings.ascx // configuration tab (Host)
└── web.config // if you need local overrides

The Module.dnn manifest can be as simple as a "blank" module (no public views). We only need to expose the Host Settings tab.

Encrypted HostSettings

DNN offers HostController.Instance.UpdateEncryptedString(key, value, decryptionKey) to store credentials encrypted with the decryption key from web.config. Create four entries:

using DotNetNuke.Entities.Host;
using DotNetNuke.Common.Utilities;

string decryptionKey = Config.GetDecryptionkey();

HostController.Instance.Update("Neuroon.ShopId", "shop_xxxxxxxx", true);
HostController.Instance.UpdateEncryptedString("Neuroon.ApiKey", "sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", decryptionKey);
HostController.Instance.Update("Neuroon.ApiUrl", "https://dev-api.neuroon.ai", true);
HostController.Instance.Update("Neuroon.WidgetTokenCache", "", true);

Citation: the end-to-end recipe uses this pattern in docs/docs/recipes/dnn-end-to-end.md (Step 1).

And a helper to read them with strong typing:

using DotNetNuke.Entities.Host;
using DotNetNuke.Common.Utilities;

public static class NeuroonSettings
{
public static string ShopId =>
HostController.Instance.GetString("Neuroon.ShopId");

public static string ApiKey =>
HostController.Instance.GetEncryptedString("Neuroon.ApiKey", Config.GetDecryptionkey());

public static string ApiUrl =>
HostController.Instance.GetString("Neuroon.ApiUrl", "https://api.neuroon.ai");
}

Validate the installation

After adding the HostSettings, run once (from a private endpoint, a maintenance page, or a breakpoint in Application_Start):

using var http = new HttpClient { BaseAddress = new Uri(NeuroonSettings.ApiUrl) };
http.DefaultRequestHeaders.Add("X-Shop-API-Key", NeuroonSettings.ApiKey);

var resp = await http.GetAsync("/api/plugin/shops/me");
resp.EnsureSuccessStatusCode();
var body = await resp.Content.ReadAsStringAsync();
DnnLog.Info("Neuroon shop info: " + body);

If you receive 200, credentials are correct. If you receive 401, check the key and the decryption key in web.config.

Permissions and firewall

DNN is typically deployed behind IIS/ARR/Application Gateway. Make sure the AppPool can reach:

  • https://api.neuroon.ai (Production)
  • https://dev-api.neuroon.ai (Development)
  • https://cdn.neuroon.ai (widget loaded from the browser)

If your Skin's CSP filters third-party resources, add cdn.neuroon.ai and the API hosts to script-src and connect-src.

Next steps