all groups > dotnet interop > august 2005 >
You're in the

dotnet interop

group:

VS2005 (beta) C# Win App: Call to CoInitializeSecurity fails with 0x80010119 (RPC_E_ TOO_LATE)



VS2005 (beta) C# Win App: Call to CoInitializeSecurity fails with 0x80010119 (RPC_E_ TOO_LATE) Scott Smith
8/28/2005 5:11:50 AM
dotnet interop: C# code that compiled and ran successfully in VS 2003 is compiling but
failing in VS 2005:

[MTAThread]

static void Main(string[] args)

{

CoInitializeSecurity(IntPtr.Zero, -1, IntPtr.Zero, IntPtr.Zero,
(uint)RpcAuthnLevel.PktPrivacy, (uint)RpcImpLevel.Impersonate, IntPtr.Zero,
(uint)EoAuthnCap.DynamicCloaking, IntPtr.Zero); // Initialize COM with
Impersonate first



The CoInitializeSecurity call returns 0x80010119 (RPC_E_ TOO_LATE),
basically saying that security must be initialized before any martialling
has taken place. I Googled on this and tried removing the "[MTAThread]"
attribute, but I always get the same error.



Does anyone know about this? This is the same code that worked fine in the
VStudio 2003, so I'm guessing that there is some new COM initialization
going on in 2005 that wasn't there before?

So far, I've been unable to find anything in the docs, though. Any help
would be greatly appreciated.

-Scott

Re: VS2005 (beta) C# Win App: Call to CoInitializeSecurity fails with 0x80010119 (RPC_E_ TOO_LATE) Scott Smith
8/28/2005 5:13:35 AM
[quoted text, click to view]
(snip)

Heh, oops. That should read "marshalling"...

AddThis Social Bookmark Button