Support Thread

Error Message When Loading The Forum The First Time

Error Message When Loading The Forum The First Time — APG vNext Guide

Error Message When Loading The Forum The First Time — this archived support thread from the APG vNext community covers a reported issue and its resolution.

Troubleshooting This Issue

  1. Set customErrors mode="Off" in web.config to expose the full error and stack trace.
  2. Check Windows Event Viewer → Application log for ASP.NET exceptions.
  3. Review Admin Panel → Logs → Error Log for timestamped application errors.
  4. Restart the IIS Application Pool to clear stale state.
  5. Verify the database connection string and run any pending upgrade SQL scripts.

Related Resources

Error on First Forum Load After Installation in APG vNext

Errors on the very first page load after a fresh APG vNext installation are almost always configuration errors - the application cannot connect to the database, find the licence key, or locate a required file. This guide covers the most common first-load errors and their exact fixes.

Error: "Could not connect to SQL Server"

-- Verify the connection string (web.config):
Server=.\SQLEXPRESS;Database=ForumDB;Integrated Security=True
-- Or with SQL auth:
Server=sqlserver;Database=ForumDB;User Id=apg;Password=pass

-- Test connection from the server:
sqlcmd -S .\SQLEXPRESS -d ForumDB -Q "SELECT 1"

Error: "Invalid object name 'dbo.apg_Settings'"

The database setup script did not run, or ran under a different schema. Run it again:

sqlcmd -S .\SQLEXPRESS -d ForumDB -i "C:orum\install\sqlpg-schema.sql"

Error: "Could not load file or assembly 'APGCore'"

The DLL deployment is incomplete. Redeploy and ensure all files in the APG vNext /bin/ folder are present. Do not deploy with antivirus scanning the bin folder during deployment - quarantined DLLs cause this error.

Error: "Licence key not found"

<!-- Ensure web.config has the key -->
<add key="APG.LicenseKey" value="YOUR-KEY-OR-TRIAL" />

First-Load Compilation Delay

On the very first request after deployment, ASP.NET compiles all views. This takes 30-60 seconds and is normal. Subsequent requests load instantly. If the first request times out (IIS default 90s timeout), increase it:

<system.web>
  <httpRuntime executionTimeout="300" />
</system.web>

IIS Application Initialisation for Instant First Load

By default, IIS starts the application pool only when the first HTTP request arrives — causing the first visitor to experience the full ASP.NET compilation and application startup delay. Enable IIS Application Initialisation to pre-warm the application pool as soon as IIS starts, eliminating the cold-start delay for the first real visitor. Configure it in the application pool Advanced Settings and the site's web.config:

<!-- ApplicationHost.config (IIS level): -->
<applicationPool name="YourAPGPool" startMode="AlwaysRunning" />

<!-- site web.config: -->
<system.webServer>
  <applicationInitialization remapManagedRequestsTo="/startup.htm" skipManagedModules="true">
    <add initializationPage="/" hostName="yourforum.com" />
  </applicationInitialization>
</system.webServer>

With Application Initialisation enabled, IIS serves a lightweight static placeholder page (startup.htm) to any requests that arrive during the pre-warming phase, then switches to serving the fully initialised application once it is ready. For APG vNext forums with large member databases, the pre-warming phase typically completes in under 10 seconds.

Diagnosing Startup Errors with Failed Request Tracing

For first-load errors that do not produce useful messages even with customErrors mode="Off", enable IIS Failed Request Tracing (FREB). FREB logs every request that fails with a 500 error, capturing the full execution pipeline including module events, handler execution, and timing. Enable it in IIS Manager → [Site] → Failed Request Tracing Rules, and configure it to trace requests with status code 500. After the next first-load failure, read the generated XML trace file in IIS Manager to see exactly which module or handler threw the error. This is particularly useful for catching errors in HTTP modules that run before the APG vNext application code and therefore don't appear in the APG error log.

Checking ASP.NET Global Error Handlers

APG vNext registers a global unhandled exception handler in Global.asax. If the error occurs before Global.asax initialises (e.g., during module registration or web.config parsing), it won't be captured by the APG error log — it will only appear in the Windows Event Log. Always check Windows Event Viewer → Windows Logs → Application first for first-load errors to confirm whether the error is pre- or post-application startup.

Smoke Testing After Deployment

After resolving the first-load error and confirming the forum loads successfully, run a quick smoke test to verify all core functionality works before announcing the forum to members. The APG vNext smoke test checklist includes: home page loads and displays recent threads, forum list page shows all configured forums, a thread page opens and displays posts correctly, member login works and the session persists across page loads, the Rich Text Editor loads on the new post page, an image upload completes without errors, and the Admin Panel loads and shows the dashboard correctly. Running this checklist takes less than five minutes and catches secondary errors that may not be visible on the home page alone but would impact member experience immediately.

Documenting and Sharing Installation Notes

After resolving first-load installation errors, document the specific steps taken in a team wiki or a text file stored with your deployment artefacts. Installation environments vary — hosting provider configurations, SQL Server versions, IIS versions, and Windows Server editions all affect which errors occur. Documented installation notes save significant time if you ever need to reinstall on the same or a similar environment, and they help colleagues who might perform future installations without access to the original installer's knowledge. Include the APG vNext version, date, server OS and IIS version, SQL Server version, any non-default web.config settings, and a summary of any errors encountered and how they were resolved.

Related Resources


Looking for more help? Browse the support forum or check the Knowledge Base.