I have a ASP.NET "website" which uses a 32-bit dll. When I XCOP开发者_高级运维Y to our 64-bit server, the page which uses this 32-bit dll throws an exception. I've already set the "Enable 32-Bit Applications" to True for the App Pool the site runs on but that doesn't help.
I'm also trying to set the target platform to x86 but the Website has no option for it unlike a Web app.
Here's the stack trace -
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 7/13/2010 5:01:12 PM
Event time (UTC): 7/13/2010 9:01:12 PM
Event ID: 9611671ef6b845f39af6b26b89af85e3
Event sequence: 51
Event occurrence: 4
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/2/ROOT-1-129235271319338750
Trust level: Full
Application Virtual Path: /
Application Path: C:\Site\
Machine name: WWWTEST
Process information:
Process ID: 4020
Process name: w3wp.exe
Account name: IIS APPPOOL\WWWTEST AppPool
Exception information:
Exception type: COMException
Exception message: Retrieving the COM class factory for component with CLSID {58968145-CF05-4341-995F-2EE093F6ABA3} failed due to the following error: 80040154.
Request information:
Request URL: http://site/Downloads.aspx
Request path: /Downloads.aspx
User host address: 192.168.1.101
User:
Is authenticated: False
Authentication Type:
Thread account name: WWWTEST\Webtest
Thread information:
Thread ID: 4
Thread account name: WWWTEST\Webtest
Is impersonating: False
Stack trace: at Downloads.Button_Click(Object Sender, DataGridCommandEventArgs E) in C:\Site\Downloads.aspx.vb:line 1034
at System.Web.UI.WebControls.DataGrid.OnItemCommand(DataGridCommandEventArgs e)
at System.Web.UI.WebControls.DataGrid.OnBubbleEvent(Object source, EventArgs e)
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
at System.Web.UI.WebControls.DataGridItem.OnBubbleEvent(Object source, EventArgs e)
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
at System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e)
at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
I did an online search for the exception "Retrieving the COM class factory for component with CLSID {58968145-CF05-4341-995F-2EE093F6ABA3} failed due to the following error: 80040154." and enabled the 32-bit mode on IIS7 but still no luck.
Any help is greatly appreciated.
** ANSWER ** I was able to fix this issue with the help from user Kev. Here's what I did -
- Download Microsoft Developer Support OLE File Property Reader 2.1 Sample (KB 224351) from here
- Extract the contents to a temp folder using WinZip/7-zip etc. Don't run the Setup. Copy the files "Interop.DSOFile.dll" and "dsofile.dll" from the extracted location over to the bin directory of the app on the Server.
- Open a cmd prompt with Admin rights and navigate to the bin directory on the Server
- Type in "regsvr32 dsofile.dll"
- Make sure the App Pool is set to Enable 32-Bit applications.
- Restart IIS
Thank you very much, Kev. I really appreciate it.
This sounds like the COM component isn't registered on the server. You need to copy the component (dsofile.dll) to the server and run regsvr32.exe
to register it:
regsvr32 dsofile.dll
You also need to make sure that the account that the website runs under has read access to this file or its containing folder.
It might also be worth trying building your project and changing the build to target x86 instead of Any CPU, though I doubt that's the problem.
You probably need to set the application pool the app is running in to run as x86.
精彩评论