M
Michael
Hi,
If anyone can help me identify the problem here I would appreciate it!
Here
are the details:
I created a Windows based .NET application that has a reference to a
COM object. The COM object was instainted successfully and all the
calls to this COM object worked fine.
I moved the classes that referenced the COM object into a WebService
and made a reference to the COM object, esstially the exact same code.
When the WebService instanitates the COM object within a try block it
seems ok but as soon as I attempt to call a method on the COM object
it raises an
NullReferenceException. Here are some of the details in the exception:
_COMPlusExceptionCode -532459699
_HResult -2147467261
_message "Object reference not set to an instance of an object."
_xcode -1073741819
_xptrs 11989016
HResult -2147467261
Here are things that I have tried:
- using the tlbimp utility to create a .NET assembly and referencing
the wrapper assembly
- I gave administrator privelegdes to the aspnet_wp user
- removed the IIS anynonyous flag and connect with web.config set to
impersonate
- added the following line before the COM is created:
Thread.CurrentThread.ApartmentState = ApartmentState.STA;
- moved and reregistered the COM's dll in the same bin directory as
the webservice itself.
Thanks in advance for your help.
Mike
If anyone can help me identify the problem here I would appreciate it!
Here
are the details:
I created a Windows based .NET application that has a reference to a
COM object. The COM object was instainted successfully and all the
calls to this COM object worked fine.
I moved the classes that referenced the COM object into a WebService
and made a reference to the COM object, esstially the exact same code.
When the WebService instanitates the COM object within a try block it
seems ok but as soon as I attempt to call a method on the COM object
it raises an
NullReferenceException. Here are some of the details in the exception:
_COMPlusExceptionCode -532459699
_HResult -2147467261
_message "Object reference not set to an instance of an object."
_xcode -1073741819
_xptrs 11989016
HResult -2147467261
Here are things that I have tried:
- using the tlbimp utility to create a .NET assembly and referencing
the wrapper assembly
- I gave administrator privelegdes to the aspnet_wp user
- removed the IIS anynonyous flag and connect with web.config set to
impersonate
- added the following line before the COM is created:
Thread.CurrentThread.ApartmentState = ApartmentState.STA;
- moved and reregistered the COM's dll in the same bin directory as
the webservice itself.
Thanks in advance for your help.
Mike