PC Review


Reply
Thread Tools Rate Thread

Activator.CreateInstance for COM object - locks thread when inside Windows Service???

 
 
google@techretary.com
Guest
Posts: n/a
 
      18th May 2007
The problematic code runs perfectly fine and unmodified when the
application is executed as a standalone .exe. However when the same
code is executed inside Windows Service - it locks up and waits
indefinetely attempting to instantiate COM object with
Activator.CreateInstance.

The service impersonates local admin creadentials.

I am not getting any exceptions, neither raised, nor reported in
systems logs.

Code:

------------------------------------------------------------
Dim oCOMype As Type = Type.GetTypeFromProgID(sProgId)
Log.LogMessage(String.Format("Retrieved type: {0}", sProgId))

Dim oCOMObject As Object = Activator.CreateInstance(oCOMType) '''
<---- will sit on this line indefinetely
Log.LogMessage(String.Format("Instantiated type: {0}",
oCOMType.ToString))
----------------------------------------------------------


Worst part - there are no exception or hints of any kind. What could
this be attributed to? How do i get closer to a solution? I've tried
to set the enclosing thread to STA threading, doesn't help.

 
Reply With Quote
 
 
 
 
google@techretary.com
Guest
Posts: n/a
 
      24th May 2007
Bumping hoping for some COM guru to shine some light upon this issue?
The only solution i've found - is to pull the offending code out.

Thanks.

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Activator.CreateInstance an object with an internal parametrizedconstructor. Frank Rizzo Microsoft C# .NET 2 27th Jun 2007 10:07 PM
Activator.CreateInstance locks in STAThread ash.holland@gmail.com Microsoft C# .NET 3 22nd Jun 2007 09:48 PM
dynamically load DLL exception when calling Activator.CreateInstance(type, object[]) Nancy Sui Microsoft ASP .NET 1 30th Nov 2004 01:44 AM
Difference Between assembly.CreateInstance and System.Activator.CreateInstance John Jenkins Microsoft C# .NET 1 14th Oct 2004 10:00 PM
Can create object using C++ CoCreateInstance, but not using C# Activator.CreateInstance Brian Rogers Microsoft C# .NET 15 2nd Jan 2004 10:53 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:11 PM.