Skip to main content

Troubleshooting

Viewing application logs and errors​

When troubleshooting issues with PingCastle Pro, you need to view error messages and logs to diagnose problems.

Enable persistent debug logging to capture detailed application behavior:

  1. Log in to the PingCastle Pro server.

  2. Locate the appsettings.json file (usually at C:\PingCastlePro).

  3. Edit the appsettings.json file so the Logging section matches the following:

    "Logging": {
    "IncludeScopes": false,
    "LogLevel": {
    "Default": "Debug",
    "System": "Information",
    "Microsoft": "Information"
    }
    }
  4. From the same directory, open the web.config file and edit the aspNetCore tag so stdoutLogEnabled is true:

    <aspNetCore processPath="dotnet" arguments=".\PingCastlePro.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" />
  5. Open PowerShell as Administrator and run IISRESET to restart the web services.

  6. Log in and perform actions in the PingCastle Pro web portal. Check C:\PingCastlePro\logs\ to confirm PingCastle Pro is writing logs.

Platform-specific logs​

  • Event Viewer stores application errors and warnings.
  • PingCastle Pro writes debug logs to C:\PingCastlePro\logs\ when you enable them.

Common errors and solutions​

Here are common errors, their causes, and how to fix them.

Incorrect ASP.NET Core middleware version

These error messages appear when the application runs under a service and the wrong version of ASP.NET Core is installed:

ASP.NET Core error message when running under a service

ASP.NET Core error displayed in the browser

ASP.NET Core error details

This message appears when running on the command line:

Command-line error showing an incorrect .NET middleware version when running PingCastlePro.dll

Command-line error caused by a missing Windows update

Solution:

Identify the correct version of the ASP.NET Core framework and install it. If you're installing on IIS, install the ASP.NET Core Hosting Bundle.

note

The last error was related to the missing KB KB2533623.

Missing web.config

If the web.config file is missing or doesn't load the .NET module correctly, the web server treats the application as a static file and returns a 404 error.

Solution:

Download the correct web.config file from the PingCastle website and replace the existing one.

Application startup errors

When the application can't start, generic error messages appear in the browser and event log:

Browser error displayed when the application fails to start

Event log entry with event ID 1000 shown when the application fails to start

A more detailed message appears in the event log or when you run the application manually:

Event log entry with event ID 1026 showing an invalid license error

Common causes:

  • Invalid license in appsettings.Production.json
  • Missing or misconfigured application settings
  • Runtime dependencies not installed

Solution:

Check the detailed error message and correct the issue. If you see a license error, replace the license in appsettings.Production.json.

Database permissions

When the database doesn't contain the tables the application needs, the application tries to create them. If you haven't granted the permissions, PingCastle Pro generates a message and the application can't start.

SQL authentication error shown when the account lacks permission to create database tables

Requirements:

  • Permission to create tables (required on first run)
  • Permission to add, change, and remove records
  • TCP/IP enabled on SQL Server
  • A firewall that allows remote connections, if SQL Server is on a different computer

The application pool identity needs these permissions, not your user account. When the application runs under IIS, the identity is typically IIS APPPool\<app-name>. If you're running PingCastle Pro against another SQL Server, the default identity the application pool uses doesn't have access.

Confirm you can connect from a computer other than the SQL Server host. By default, a firewall can block remote connections and the database might not be exposed over TCP. In the following example, remote access is blocked because TCP/IP is disabled:

SQL Server configuration with TCP/IP disabled

Solution 1: Change the application pool identity

Configure the IIS application pool to run as an Active Directory user that has database permissions:

IIS application pool advanced settings

Application pool identity dialog

Custom account credentials dialog

Solution 2: Use SQL Server authentication

Add SQL Server credentials to the connection string in appsettings.Production.json:

;User ID=sa;Password=pass123

Connection string in the application settings file

SQL Server connection with authentication

Alternative: If you prefer not to grant table creation permissions, contact support to obtain a SQL script that creates the required tables manually.