Unable to create com object instance in .net

1

I am getting below error when try to create com object in .net for user without admin rights.

The COM class factory for component with CLSID {6CA9DEBE-BA91-4E56-9CD3-D40FE0755204} failed due to the following error Unable to retrieve: 800704ec This program is blocked by group policy. Apply to get your system administrator for more information. (Exception from HRESULT: 0x800704EC).

Code is as shown below:

dynamic obj=null; try { try { var ComType = Type.GetTypeFromProgID("XenReports.XenReportsX"); obj = Activator.CreateInstance(ComType); } catch(Exception) { throw new Exception(TextMessageProvider.GetText(ResourceKeys.XenReportErrorMessage)); }

Please let me know if any one has faced this problem. Com object is for C++ exe.

c++
.net
comobject

1 Answer

1

the problem as the error says itself, is your group policy settings. The user with which you are trying to create the COM object, does not have enough privileges under the current group policy,to do any such creation.

You can add this user to the 'admin' group on this machine and then try.

in case you are trying to access the object over network, then you also need to do the appropriate DCOM settings. Run 'dcomcnfg' then Component services->MyComputer ->DCOM Config. Now select the component and right click to change its properties like 'Launch and Activation Permissions' and which user is allowed to launch it etc.

answered on Stack Overflow Mar 5, 2015 by dorKKnight

User contributions licensed under CC BY-SA 3.0