[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

COM+ Server a Client of Another .NET Object

Robin Prosch via .NET 247

8/4/2004 11:49:00 AM

Hi,

I have a VB.NET COM+ Server object that has one simple function, it returns a connection string that it reads from the registry. I have written a very simple class library that has functions to read from the registry and get the connection string, given a registry key, with encryption and whatnot. The COM+ server simply invokes this code and returns the result to the client.

This is how things proceeded:
1. Write COM+ server that simply returns "Hello World!" to the client. Strong name it and stick it in the GAC.
2. Write COM+ client and add the server as a reference. Set the referenc's "Copy Local" property to false.
3. Use regsvcs to install the COM+ server on notebook, and set it up. Use component services to create a proxy installer.
4. Install proxy on client, copy COM+ client app to the client and run it, it returns Hello World! YES!
5. Add a reference to my COM+ server project and change the function to return the result of the method that it calls, inside this reference.
6. Rebuild COM+ server, and add the new one to the GAC.
7. Run the client app, and hey, it returns the correct connection string from the registry. (Despite the fact that I have not reinstalled the proxy.)
8. Recreate the proxy installer and install it on the client, just for kicks, and to test whether things will still work.
9. Run client app. It fails claiming that it cannot find the assembly that I added as a reference!

Help Please! This might not sound like a problem, but without the solution, I will not be able to deploy the application on site at the end of development. I could simply remove the external class library that I added as a reference to the COM+ server, but this project will become much bigger and I do not want ALL the code sitting in the COM+ server.

--------------------------------
From: Stephen Martindale

-----------------------
Posted by a user from .NET 247 (http://www.dotn...)

<Id>Iqt9QUAxhUSnVBng/UsV9Q==</Id>
1 Answer

Sunny

8/4/2004 3:42:00 PM

0

Hi,

In article <#accYkheEHA.556@tk2msftngp13.phx.gbl>,
anonymous@dotnet247.com says...
> Hi,
>
> I have a VB.NET COM+ Server object that has one simple function, it returns a connection string that it reads from the registry. I have written a very simple class library that has functions to read from the registry and get the connection string, given a registry key, with encryption and whatnot. The COM+ server simply invokes this code and returns the result to the client.
>
> This is how things proceeded:
> 1. Write COM+ server that simply returns "Hello World!" to the client. Strong name it and stick it in the GAC.
> 2. Write COM+ client and add the server as a reference. Set the referenc's "Copy Local" property to false.
> 3. Use regsvcs to install the COM+ server on notebook, and set it up. Use component services to create a proxy installer.
> 4. Install proxy on client, copy COM+ client app to the client and run it, it returns Hello World! YES!
> 5. Add a reference to my COM+ server project and change the function to return the result of the method that it calls, inside this reference.
> 6. Rebuild COM+ server, and add the new one to the GAC.
> 7. Run the client app, and hey, it returns the correct connection string from the registry. (Despite the fact that I have not reinstalled the proxy.)
> 8. Recreate the proxy installer and install it on the client, just for kicks, and to test whether things will still work.
> 9. Run client app. It fails claiming that it cannot find the assembly that I added as a reference!
>
> Help Please! This might not sound like a problem, but without the solution, I will not be able to deploy the application on site at the end of development. I could simply remove the external class library that I added as a reference to the COM+ server, but this project will become much bigger and I do not want ALL the code sitting in the COM+ server.
>
> --------------------------------
> From: Stephen Martindale
>
> -----------------------
> Posted by a user from .NET 247 (http://www.dotn...)
>
> <Id>Iqt9QUAxhUSnVBng/UsV9Q==</Id>
>

Try adding [ComVisible(false)] attribute to the public classes in the
referenced assembly. This should prevent them to be placed in the proxy.

If this not help, try posting this in the interop newsgroup, there are a
lot of experienced guys :)

Sunny