3

I have a little COM+ component as a service on a remote server.

I´m trying to execute a method of this component using:

Type type = Type.GetTypeFromProgID("ComPlusTest.ComTestClass",serverName);

// Create Service
Object service = Activator.CreateInstance(type);

// Execute Method
String result = service.GetType().InvokeMember("LaunchPackage",
    BindingFlags.InvokeMethod, null, parameters, null).ToString();

The type is returned as null.

What is the best way to do this??

The server is Windows 2003 Enterprise, the service is a .NET component wraped as COM+ (I know that I don´t have to do it that way, but the purpose is to itegrate a legacy App with a .NET component) The purpose of this is just to test that the .NET COM+ Component works.

Thanks in advance!

2
  • Is the com object register also on the client side? Commented Oct 20, 2009 at 21:02
  • No, the COM object is in other server. Commented Oct 20, 2009 at 22:51

2 Answers 2

1

I haven't tried it, but your approach makes sense. It looks very similar to the Interoperating without Proxies but with a remote server.

Perhaps you are running into some other issue (e.g. configuration or permission)?

Some troubleshooting suggestions:

Try to run your test program directly on the "remote" server.

Also, have you tried changing your first line to:

Type type = Type.GetTypeFromProgID("ComPlusTest.ComTestClass",serverName, true);

This should throw an exception if an error is encountered and may provide you with some more information on the specific issue you are hitting.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, I will add the exception flag to see if I get an exception because right now I´m getting a null.
1

I have solved the issue. The COM+ was not correctly installed on the server. I missed the step of configure the assembly in the .NET Framework Configuration Console.

The steps are:

  1. Register the assembly (configure assembly) on .NET Framework Configuration Console
  2. Register the assembly in the GAC
  3. register the COM+ Application in the Component Services Console. Then Add the Component to the actual assembly(dll)

Jeje, I missed the first one.

How ever I appreciate your time on answering the issue.

Thanks!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.