Groups | Blog | Home
all groups > dotnet distributed apps > june 2006 >

dotnet distributed apps : How to get assembly version of remote object?


Martin Müller
6/24/2006 2:46:02 PM
Dear community,
I'm looking for a way to find out the assembly version of a remote type.

In a .NET remoting application it's possible that the assembly version of a
remoted type is not the same between the client and the server.
Let's say the server has the type ServerObj in a version 1.0.0.0 in its
Server.dll assembly, but the client has an updated version 1.1.0.0 of
Server.dll at its disposal.
In the new version, ServerObj has an additional method.

As long as the client doesn't try to use the new method, things will work
like before (when both client and server were using 1.0.0.0), but when the
client uses the new method, a RemotingException is thrown (of course - the
client proxy does have the method, but the server proxy doesn't).

Now is there a way to find out the version the server is using? All my
trials only give me the assembly version from the client (1.1.0.0), but I'd
need the version from the server to keep the client from using the new method.

Is there a way without modifying the server? The application is still using
..NET 1.1 btw.

I'd be really thankful for any suggestions...

Regards,
Martin Müller
6/30/2006 1:05:02 PM
Hi Michael!

Don't know if I don't understand your suggestion or if you didn't understand
the question: I know how to get the Version of a given local assembly, but I
need the version of an assembly located at the server.

I could load the assembly by filename, but I don't know the filename of the
assembly at the server or even have file access to the server, so this is out
of question.
And trying to load an assembly "by name/version" won't work either, because
I do not know the version at the server. All I have is the same assembly name
on the client and the server...

Martin
[quoted text, click to view]
Michael Nemtsev
6/30/2006 7:13:24 PM
Hello Martin,

Load assembly by name/version or filename and call AssemblyName.Version Property


MM> Dear community,
MM> I'm looking for a way to find out the assembly version of a remote
MM> type.
MM> In a .NET remoting application it's possible that the assembly
MM> version of a
MM> remoted type is not the same between the client and the server.
MM> Let's say the server has the type ServerObj in a version 1.0.0.0 in
MM> its
MM> Server.dll assembly, but the client has an updated version 1.1.0.0
MM> of
MM> Server.dll at its disposal.
MM> In the new version, ServerObj has an additional method.
MM> As long as the client doesn't try to use the new method, things will
MM> work like before (when both client and server were using 1.0.0.0),
MM> but when the client uses the new method, a RemotingException is
MM> thrown (of course - the client proxy does have the method, but the
MM> server proxy doesn't).
MM>
MM> Now is there a way to find out the version the server is using? All
MM> my trials only give me the assembly version from the client
MM> (1.1.0.0), but I'd need the version from the server to keep the
MM> client from using the new method.
MM>
MM> Is there a way without modifying the server? The application is
MM> still using .NET 1.1 btw.
MM>
MM> I'd be really thankful for any suggestions...
MM>
MM> Regards,
MM> Martin Müller
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsch

Tasos Vogiatzoglou
7/2/2006 11:08:11 AM
Maybe GetProxiedType method of RealProxy ?

Regards,
Tasos

[quoted text, click to view]
Martin Müller
7/2/2006 11:04:02 PM
Nope, I had tried that...
But thanks for the suggestion, nevertheless!

Martin

[quoted text, click to view]
ShahidMunshi
7/27/2006 4:11:02 AM
please let me know if you got a solution i am also facing same problem

[quoted text, click to view]
James Gingco
8/16/2006 7:48:04 AM
Hi Martin,

If you have access to all the code and modifying them then you can always expose a method that can return the version.

If not, you can always write one which can stay at the same place where the server is that can load the assembly and query the version for you.

It may sound like a hack but probably better as an interim solution.

Hope that helps.

Regards,
jgingco@gmail.com
AddThis Social Bookmark Button