0
votes

my .net web application has a option of uploading a excel file, which has around 1k entries of products, the upload works fine when i run the application on localhost, but results in the following error when it is hosted on iis7 & accessed by some other computer on the network..

error

Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).

Exception Details: System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).

I googld it, and found some talking about 32-bit or 64-bit OS.

Thanks.

3
seems to be permission issue .. - Pranav
@Pranav is there anything that can be done - Nikhar
try to give the permission to DefaultAppPool ...see this link :- iis.net/learn/manage/configuring-security/… - Pranav
also some helpful link :- stackoverflow.com/questions/1491123/… - Pranav
@Pranav thanks, i have to do both the things to get it working, also in my case i changed microsoft excel application properties. - Nikhar

3 Answers

2
votes

You should avoid using Excel Interop in a server application for the reasons described in this KB article.

Instead, consider using a third-party product to manipulate the Excel document, such as EPPlus (Excel 2007+), Aspose Cells, SpreadsheetGear.

Probably your ASP.NET app is running under an account that doesn't have a profile.

1
votes

Ensure the upload folder is given full permission so as to upload from other computers. First start by giving permission to EVERYONE. Then you may restrict it to IIS user only.

1
votes

Sounds to me that when your implementing your application on the server, something isn't getting installed that your using on your development machine. Whatever your using to upload, if it is a third party upload control or something, you might not be distributing that file.

Another possibility is, that the server your installing your application on is a 64 bit machine, and the upload control your using is built for 32 bit only. You might want to set the server to 32 bit for IIS 7.

http://www.depotsystems.com/ds_mobile_webhelp/webhelp/index.htm#page=Enabling_32_bit_mode.htm