C#/COM interop working only in debugger -


i have problem com interop c# application inproc com server component.

i have reduced problem simple c# test program. instantiates server component's interop class, sets value of string property on instance, , sets string property. i'm not doing unusual marshalling. using interop class generated when added reference com component. like:

using mylib;  // interop assy // ... mycomp comp = new mycomp(); comp.prop1 = "abc"; comp.prop2 = "xyz"; 

outcomes:

  • if run test program outside vs then, when second property set, consistently comexception hresult of 0x80010105 (rpc_e_serverfault)‎.

  • if run test program inside visual studio 2005 consistently works correctly.

i wrote equivalent code in unmanaged c++ (no atl, plain interface pointers) , works correctly both in , out of vs.

my question: different environment in interop occurs when running inside debugger might account i'm seeing? assume e_rpc_serverfault being generated interop marshaller, why in debugger? suggestions how proceed this?

[i haven't said com component because question different behaviour i'm seeing in , out of debugger. com component tested , has been in production use on 7 years (thousands of invocations per day in server environment) i'm quite confident in it. 32 bit dll. have source, don't have suitable build environment it. if did, i'm not sure how debug managed code. possible?]

update

no solution yet, more observations:

  1. i tried running application administrator, , uac turned off. same result.
  2. i tried attaching process before error occurs saw no indication in output window of structured exception being thrown.
  3. i tried explicitly setting apartment model test app's main thread sta , mta, made no difference. com component apartment threaded.
  4. i tried running managed test application (outside visual studio) on win2003 machine , different win7 pro machine. worked correctly on both.

the last item points issue machine, i'm not sure what.

[the environment framework 2.0 running on win7 pro 32 bit visual studio 2005 pro.]

is possible running anycpu build, , reason visual studio loads assembly 32bit, when run program outside vs, runs x64 , cannot load 32-bit com dll?


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -