The Problem
This morning I opened IIS Management Console on my Windows machine and noticed that almost no options were available. When I checked the Event Viewer, I found multiple errors like this:
IISMANAGER_ERROR_LOADING_PROVIDER_TYPE
IIS Manager could not load typeMicrosoft.Web.Management.AspNet.ErrorPages.ErrorPagesModuleProvider, Microsoft.Web.Management.Aspnet, Version=10.0.0.0, Culture=neutral, PublicKeyToken=%WINDOWS_PUBLIC_KEY_TOKEN%
for module provider ‘ASPNETErrorPages’…
Screenshot: IIS Manager Empty
Screenshot: Event Viewer Errors
The issue was caused by an invalid assembly reference inside the IIS configuration file administration.config
.
The Fix
Here’s the PowerShell script I used to fix the problem. It:
- Closes IIS Manager.
- Backs up the original
administration.config
. - Replaces invalid assembly references (
PublicKeyToken=%WINDOWS_PUBLIC_KEY_TOKEN%
) with the correct value. - Fixes the namespace typo (
Aspnet
→AspNet
). - Restarts IIS Manager.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Close IIS Manager
Get-Process inetmgr -ErrorAction SilentlyContinue | Stop-Process -Force
# Paths
$cfg = "$env:windir\System32\inetsrv\config\administration.config"
# Backup the file
Copy-Item $cfg "$cfg.bak_$(Get-Date -Format 'yyyyMMdd-HHmmss')" -Force
# Load, patch, save
$txt = Get-Content $cfg -Raw
$txt = $txt -replace 'PublicKeyToken=%WINDOWS_PUBLIC_KEY_TOKEN%', 'PublicKeyToken=31bf3856ad364e35'
$txt = $txt -replace 'Microsoft\.Web\.Management\.Aspnet', 'Microsoft.Web.Management.AspNet'
Set-Content -Path $cfg -Value $txt -Encoding UTF8
# Sanity: make sure the assemblies exist
Test-Path "$env:windir\System32\inetsrv\Microsoft.Web.Management.AspNet.dll"
Test-Path "$env:windir\System32\inetsrv\Microsoft.Web.Management.dll"
# Launch the 64-bit console explicitly
Start-Process "$env:windir\System32\inetsrv\InetMgr.exe"
Result
After running the script, IIS Manager loaded normally and all configuration options became available again. ✅ Fixed in less than 5 minutes! If you face the same issue, this approach should help. Just remember to always backup your configuration before making changes.
Screenshot: IIS Loaded
Conclusion
Sometimes Windows updates or broken installations leave behind invalid configuration entries. By inspecting the Event Viewer logs, we can identify the exact problem and fix it quickly with a script. Hopefully this post saves you the headache I had this morning.