I have a web application where user run queries(through web interface) and gets output in excel format. Sometimes this output comprises of more than 300k records. The user needs this data for further research.
Now in order to speed up the dynamic excel creation with such large volume of data, we are using "Microsoft.Office.Interop.Excel" COM object.
Our code works completely fine on the in-built asp.net development server. However, when hosted on the IIS, it gives us "Access is Denied" error (exact error is as shown below).
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 have given all the rights to the IIS user but still this is not working.
I have tried Windows Server 2012 R2 as well as Windows 7 OS and it doesn't work on both of them.
I have made changes to the "DCOMCNFG" and granted access to the web users under the "COM Security" tab also.
What are some additional steps I can take to make this work?
Have a look at the following links -
"Retrieving the COM class factory for component.... error: 80070005 Access is denied." (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
http://forums.iis.net/t/1205506.aspx?Retrieving+the+COM+class+factory+for+component+with+CLSID+failed+due+to+the+following+error+80070005+access+is+denied
https://waheedrous.wordpress.com/2014/01/26/error-office-interop-assemblies/
This is a COM permissions problem.
Start > Run > dcomcnfg
Navigate to Component Services > Computers > My Computer > DCOM Config
Locate the Microsoft Excel Application
Right click > Properties
On the security tab: Select Security under Launch and Activation Permissions and click Edit…
Add the account under which the site is running (eg: Network Service) and assign Local Launch & Local Activation permissions
Source
Also the ASP.NET Authentication should be enabled.
I think for this to work, office has to be installed on the server.
So if this is not the case, install Office on the server.
(alternative is to use OpenXml http://www.microsoft.com/en-us/download/details.aspx?id=30425)
I have decided to give up on using COM object for Excel operation on the server. Instead, I have decided to use EPPlus open office XML SDK for generation of Excel files. This works without any additional security permission requirement on the server.
Related
I am using Interop.TDAPIOLELib dll to connect to ALM (application lifecycle managment).
In order to connect to the project i am using TDConnection but when executing this line
_connection = new TDAPIOLELib.TDConnection();
i get this exception
Retrieving the COM class factory for component with CLSID {C5CBD7B2-490C-45F5-8C40-B8C3D108E6D7} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
This code was working fine before i repaired my HD
I run sfc/scannow and i got this message Windows Resource Protection did not find any integrity violations. Which indicate that i do not have any missing or corrupted system files.
any suggestions?
OTAClient.dll should be registered
using regsvr32.exe register the OTAClient.dll it located in this path C:\Program Files (x86)\Common Files\Mercury Interactive\TDAPIClient and make sure that the application is run under x86 target.
It's necesary to download the TDConnect.exe
Go to your HP ALM web interface
'Tool' link
'HP ALM Connectivity' link
Click on 'Download HP ALM Connectivity'
it will download TDConnect.exe file, you need to do this trhu your instance to match the TDConnect.exe with your version, for example if you are running HP ALM 11.52 you MUST download the TDConnect.exe for this version.
although this is an old question, but sharing what worked for me - the solution mentioned here - http://www.juvander.fi/site/Forums/tabid/129/forumid/2/threadid/14/scope/posts/Default.aspx
may help someone if nothing else works
I try convert Office documents using Office.Interop running under separate Windows service.
This service is running under specific account (username in future).
All folder access rights is set for this account. And when i try to create any of Office application (for example, var app=new Excel.Application()) then my code fails with exception:
Retrieving the COM class factory for component with CLSID {XXXX} failed due to the following error: E_ACCESSDENIED.
Ok, but i have already configured the DCOM permissions for this CLSID! I open the dcomcnfg.exe , select component with this CLSID, opening settings, security and see that user of this service have all rights for this component.
Why this exception throws?
Ocka guys, i found the answer.
1) Be sure that you have install a right version of Office 2007
2) Be sure that you have install a PDF\XPS addin
3) Just office and its addin installed, you should run DCOMCNFG and pick My Computer->DCOM config. As it turned out, after office installation there is no mappings between CLSID and AppID in registry.
4) Close dcomcnfg window. Now there is right mappings in registry. You should get all things related to office (its id, e.g. {XXXXXXX-XXXX...}) in HKCR\AppID and HKCR\CLSID
5) For all these id's you should grant access, this can be achieved using this algorythm:
* open HKCR\AppID{id} key
* setup LaunchPermission and ActivatePermission values (code to do this find there in stackoverflow)
* Set value "RunAs" as "Interactive User"
Ocka, your office automation should work correctly, if i didn't forget some step..
i am trying to deploy an asp.net web service application to IIS 7.5. The application used .Net framework 3.5. dev machine is win 7 64bit. i have used following code snippet to create HTML and then convert it to pdf using Amyuni Document Converter 450.
private InternetExplorer internetExplorer = new InternetExplorerClass();
when i deploy the application in local development server it perfectly run but whn i deploy it using the local iis server it gives following error. any reasons for that.. i have used impersonate='true'
System.Runtime.InteropServices.COMException (0x80080005): Retrieving the COM class factory for component with CLSID {0002DF01-0000-0000-C000-000000000046} failed due to the following error: 80080005.
You have to change property in DComConfig for ie.
Follow the next steps:
Start->Run->dcomcnfg->Component services>Computers>My Computer
Right click on My Computer and select Properties. On the Security COM tab set the Default Autethentication level and Default Impersonation level.
Hi I just tryed to run my application fopr the first time on IIS.
Everything worked find while developing on visual studio but when I added the app to IIS I got this error:
Cannot open user default database. Login failed.
Login failed for user 'IIS APPPOOL\forum'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Cannot open user default database.
What should I do the site works when I run it from visual studio?
EDIT
I did a litle more digging and I managed to find out that I needed to setmy application pool identity to NetworkService I did that but now I got another error :
Unable to open the physical file "D:\Projects IDE\Visual Studio\MyWork\Websites\Forum\App_Data\ASPNETDB.MDF". Operating system error 5: "5(Access is denied.)".
An attempt to attach an auto-named database for file D:\Projects IDE\Visual Studio\MyWork\Websites\Forum\App_Data\ASPNETDB.MDF failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
Please check two places
1 Access to folder for the NetworkService identity(default for IIS app pool) or for this one(IIS APPPOOL\forum)
2 Connection string credetial. And if there "Integrated security". Provide Specific user and passwrod there.
I received this non explicit error because I had the Application Pool set to .NET 2.0 as opposed to .NET 4.0 on a service that was responsible for authentication. Typically when the framework is incorrect a different type of error about a non-recognized framework .dll is displayed, but not in this case. If this happens, check the following:
The value after IIS APPPOOL is the name of the application pool this current process is run under. In your case there was an AppPool named forum.
Check that the app pool is using the corrected pipeline and .NET Framework required for the application being run.
I am a .Net developer. New to OPC. When I tried some samples of OPC Client all of them give this error. It seems the DLL is not registered it seems. But I don't know how and where to register this.
error: retrieving the COM class factory for component with CLSID failed due to the following error: 80040154
Even I tried this
regsvr32 Interop.OPCAutomation.dll",
but it also throws error like
The module "Interop.OPCAutomation.dll" was loaded but the entry-point DllRegisterServeer was not found.
Make sure that "Interop.OPCAutomation.dll" is a valid DLL or OCX file and then try again.
I have gone through so many existing forums. So many of them said to change the Platform Target to x86 and still I am having the same issue. FYI, I can see only see 'Active (Any CPU)' in the Platform option from the top of the Build tab of Project Properties.
Here are my environment details:
.Net 2005
OPCAutomation Weapper
Windows 7 64-bit OS
Dell Inspiron 1525 (I hope this is not a 64bit machine, but my engineer installed 64bit OS somehow).
Please help me.
Thanks in advance!
Just in case somebody is dealing with this problem (as I've recently been...) I get through it! After some time, I found out that it's something about the .NET framework running on 64-bit machines. As long as the.NET application works only with 32-bit CLR, we must set .NET framework to load CLR in WOW mode. To do so, type:
C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Ldr64.exe SetWow
After this you should be able to run the applications.
You can go back and revert .NET Framework as it was before by typing:
C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Ldr64.exe Set64
If the OPC Client Toolkit SDK (C++) is used, a problem with the remote registry service may cause this error as well.
On Windows 7, by default the Remote Registry service is set to manual and not started. Ensure that the Remote Registry service is started on all of the machines you want to deploy to. This can be done manually or using Group Policy.
The function GetCLSIDFromRemoteRegistry() uses the RemoteRegistryService in order to get the CLSID of an OPC Server. If this service is not started on the client machine, the OPC program may return the error 80040154.
The error you're getting is more than likely due to the OPC server not being properly registered. Make sure it is registered (usually by running it at the command line with a "/regserver" or "/service" parameter). There may also be security issues in which case you'd have to run 'dcomcnfg' (DCOM Config) to make sure the client has access to the server.
This question is a bit dated so I hope you figured it out by now, but I had the same exact issue and wanted to share my solution. In my case, I am using a Kepware server. If you compile and try to run a client application for this server using Interop.OPCAutomation on a machine that does not have the server installed, you will get a dll not registered error and "entry point not found" if you try to register the dll manually.
Solution: Make sure you've got the server installed and running.
Although this is an old post, I would like to share my solution.
My problem was that when I tried to install an application with the OPCAutomation.dll, it gave me 80040154 error because the class was not registered.
This is my solution, always with Administrator privileges:
Copy OPCDAAuto.dll into the "C:\Windows\System32" folder
On the cmd prompt type "C:\Windows\System32\regsvr32 opcdaauto.dll"
You should watch a message like this one:
image
Hope this helps!
The OPC dll only works in 32 Bits, my solution was to change the "Enable 32-Bit Applications" to True in the advanced settings of the relative app pool in IIS.