迁移Web应用至新服务器后IIS出现ASP 0177:800aea5f错误求助
Hey there, let's work through this ASP error together—no need to feel overwhelmed even if you're new to IIS, DLLs, or the registry. Here's a step-by-step guide tailored to your migration scenario:
This error pops up when your ASP code tries to use Server.CreateObject() but can't find the required COM component, or doesn't have permission to access it. Since you just migrated the app, the most likely issue is that a component from your old server isn't properly set up on the new one.
Step 1: Identify Which Component Is Missing
First, you need to know exactly which object your code is failing to create:
- Open the ASP page that's throwing the error, and look for lines like
Set obj = Server.CreateObject("Xxx.Yyy")(theXxx.Yyypart is called the "ProgID" of the component). - If you can't pinpoint the page, check IIS's error logs for details:
- Open IIS Manager, select your website, then click "Logs" on the right-hand panel.
- Open the latest log file—you'll find the specific ASP filename and the problematic ProgID there.
Step 2: Install/Register the Missing Component
Case 1: System-Built Components (e.g., ADODB.Connection, Scripting.FileSystemObject)
These are pre-installed with Windows, but sometimes they need to be re-registered:
- Open Command Prompt as Administrator.
- For ADODB, run:
regsvr32.exe "C:\Windows\System32\msado15.dll" - For the Scripting component, run:
regsvr32.exe "C:\Windows\System32\scrrun.dll" - You should see a success message if the registration works.
Case 2: Custom/Third-Party DLL Components
If this is a custom DLL from your old server:
- Copy the DLL file to a safe directory on the new server (e.g.,
C:\Windows\System32or your website'sbinfolder). - Open Command Prompt as Administrator, navigate to the DLL's directory, and run:
regsvr32.exe YourComponentName.dll - If registration fails:
- Make sure you copied all dependent files that the DLL needs (check the old server's directory where the DLL was stored).
- If you're on a 64-bit server and the DLL is 32-bit, use the 32-bit regsvr32:
C:\Windows\SysWOW64\regsvr32.exe YourComponentName.dll
Step 3: Check IIS Application Pool Settings
Permissions and architecture mismatches often cause this error:
- Open IIS Manager, find the Application Pool assigned to your website.
- Right-click it and select "Advanced Settings":
- Enable 32-Bit Applications: If your component is 32-bit, set this to
True(64-bit servers default toFalse). - Identity: Try temporarily changing the identity to
LocalSystem(this is a broad permission test—once it works, switch back to a more restricted identity likeApplicationPoolIdentityfor security).
- Enable 32-Bit Applications: If your component is 32-bit, set this to
- Restart the application pool after making changes.
Step 4: Test the Component with a Simple ASP Page
Create a quick test page to verify if the component works outside your main app:
<% On Error Resume Next ' Replace "Xxx.Yyy" with your component's ProgID Set testObj = Server.CreateObject("Xxx.Yyy") If Err.Number <> 0 Then Response.Write "Failed to create object: " & Err.Description & " (Error Code: " & Err.Number & ")" Else Response.Write "Object created successfully! ✅" Set testObj = Nothing End If %>
Save this as test-component.asp in your website's root directory, then access it via browser. This will tell you if the component itself is working.
Step 5: Fix Registry Permissions (If All Else Fails)
If the component is registered but still throws errors, the IIS process might not have permission to read its registry entry:
- Open Registry Editor (
regedit.exe) as Administrator. - Navigate to
HKEY_CLASSES_ROOT\Xxx.Yyy(replaceXxx.Yyywith your component's ProgID). - Right-click the registry key, select "Permissions".
- Click "Add", type
IIS AppPool\YourAppPoolName(replace with your application pool's name), and click "Check Names" to confirm. - Give this user "Read" permission, then click "OK".
- Restart IIS and your application pool.
内容的提问来源于stack exchange,提问作者m28

