Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Distributed Applications / August 2006

Tip: Looking for answers? Try searching our database.

How to get assembly version of remote object?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Martin Müller - 24 Jun 2006 22:46 GMT
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
Michael Nemtsev - 30 Jun 2006 20:13 GMT
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
Martin Müller - 30 Jun 2006 21:05 GMT
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

> Hello Martin,
>
[quoted text clipped - 36 lines]
> "At times one remains faithful to a cause only because its opponents do not
> cease to be insipid." (c) Friedrich Nietzsche
Tasos Vogiatzoglou - 02 Jul 2006 19:08 GMT
Maybe GetProxiedType method of RealProxy ?

Regards,
Tasos

> Dear community,
> I'm looking for a way to find out the assembly version of a remote type.
[quoted text clipped - 22 lines]
> Regards,
> Martin Müller
Martin Müller - 03 Jul 2006 07:04 GMT
Nope, I had tried that...
But thanks for the suggestion, nevertheless!

Martin

> Maybe GetProxiedType method of RealProxy ?
>
[quoted text clipped - 27 lines]
> > Regards,
> > Martin Müller
ShahidMunshi - 27 Jul 2006 12:11 GMT
please let me know if you got a solution i am also facing same problem

> Nope, I had tried that...
> But thanks for the suggestion, nevertheless!
[quoted text clipped - 32 lines]
> > > Regards,
> > > Martin Müller
James Gingco - 16 Aug 2006 15:48 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.