问题
I have an ASP.NET website on IIS and it generates Excel files automatically, the problem is I keep getting this error:
"Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005."
I have tried almost everything on the net to solve this problem but I couldn't: I have changed the DCOM configurations of Excel for the user used for the website, created Desktop folder in System32 and SysWOW64 with full control for the same user, I even changed the security settings of the Miscrosoft Office installation folder to the same user but with no luck.
In my case my website connects to another server with SQL Server Reporting Service to retrieve some reports so if I change the user the website uses to "LocalSystem" user I can't fetch reports from the second server but I can generate Excel files.
So the solution might be one of two: either I can create the Excel files with this user or retrieve reports from the second server as a "LocalSystem" user.
回答1:
I had a same problem. Here is the solution for the same.
Go to your IIS Manager. → ApplicationPools → AdvancedSettings → Enable32BitApplication → True.
Also give full access to your folder.
It might be helpful for you.
回答2:
try to do the following:
- Make sure Office interop assemblies are installed.
- Check the version of the assemblies on development and production.
- Create Desktop folder under systemprofile.
- set the DCOM security explicitly for the service user.
you can find more details here
来源:https://stackoverflow.com/questions/15106809/retrieving-the-com-class-factory-for-component-with-clsid-00024500-0000-0000-c0