Hi everybody,
I have created a c# module using late-binding to call methods of a com
component.
Everything works fine in a console application but when I use this module in
a web application I've got this exception : System.MissingMethodException:
Method System.__ComObject.MyMethod not found. Here is my code :
Type _UserComType = Type.GetTypeFromProgID("MyDll.MyClass");
object _UserCom = Activator.CreateInstance(_UserComType);
object[] parameters = new object[2];
parameters[0] = "Data1";
parameters[1] = "Data2";
object result = _UserComType.InvokeMember("MyMethod",
BindingFlags.InvokeMethod, null,_UserCom,parameters);
Does anybody have a idea to solve this problem ?
Willy Denoyette [MVP] - 10 Jan 2006 18:57 GMT
Are you sure you COM dll is registered and accessible from asp? And why are
you using late binding?
Willy.
| Hi everybody,
|
[quoted text clipped - 15 lines]
|
| Does anybody have a idea to solve this problem ?
christof13 - 11 Jan 2006 08:55 GMT
The com is well registered and is accessible from asp. It's strange because
the com component is well found and the exception occurs on the method call
(invokemember).
We are migrating a COM module into a .Net module. During the migration
we need to have te possibility to switch between both module. When the
migration will be over we don't want to recompile the project to remove the
com reference.
This is the reason why I am using late binding.
> Are you sure you COM dll is registered and accessible from asp? And why are
> you using late binding?
[quoted text clipped - 21 lines]
> |
> | Does anybody have a idea to solve this problem ?