System.Runtime.InteropServices.COMException: Unknown error (0x80005000)


This is the detailed error info.

Failures: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException: Unknown error (0x80005000) at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) at System.DirectoryServices.DirectoryEntry.Bind() at System.DirectoryServices.DirectoryEntry.get_NativeObject()

Code that causes the above exception:

 DirectoryEntry de1 = new DirectoryEntry("RNA:");
 IRnaNamespace rnaNamespace = (IRnaNamespace)de1.NativeObject;

After the del object is created, I try to watch the values for variant del, and this is the result: link text alt text

The OS is Windows2008 R2 64bits. And it can run successfully on Windows2008Sp2 32bit.

asked on Stack Overflow Nov 17, 2009 by Carlos Liu • edited Nov 17, 2009 by Graviton

1 Answer


The error is caused by the following statement:

DirectoryEntry de1 = new DirectoryEntry("RNA:");

Because it will call another project AAA which is built in 32 bits system to create the directory. After rebuilt AAA in 64 bits, everything is OK.

answered on Stack Overflow Nov 25, 2009 by Carlos Liu

User contributions licensed under CC BY-SA 3.0