all groups > dotnet remoting > may 2005 >
You're in the

dotnet remoting

group:

Windows service and remoting


Windows service and remoting Ray5531
5/3/2005 3:00:22 PM
dotnet remoting:
We have a solution consists of an O/R mapper project,Business Logice layer
and a Web application.I need to add a windows service to this solution and
add the business logic layer as a reference to my windows service.We are in
development phase and it's very probable that the business layer is
changed.They promise to keep the interface intact.I mean they promise to
keep the name of the method I need always "Upload" ,but they might change
the assembly and compile it into the new version.

I was thinking if there is a technique like Reflection,Remoting or
latebinding or whatever it is which I can use and get rid of compiling my
windows service whenever they change the business layer and complie it to a
newer version.I was reading this article
http://www.15seconds.com/issue/021015.htm and I just wondered if I could
business logic layer as a plug in into my windows service.

Any suggestions?

Thanks

P.S windows service and web application might be in different boxes.

Re: Windows service and remoting Beth Massi [Architect MVP]
5/5/2005 7:48:45 PM
Ray,

You can actually solve this pretty easily with an assembly binding redirect.
Here's the msdn info:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconAssemblyVersionRedirection.asp

Since what you want is really to redirect to an OLDER version (the version
that is sitting with the windows service) it would look something like this:

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="TheServerAssembly"
publicKeyToken="86d3cc6071f2ab51"
culture="neutral"
/>
<!-- This says that for this range of versions on the server,
always use the build I have on the client. -->
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0"
newVersion="1.0.5.22885"/>
</dependentAssembly>
</assemblyBinding>
</runtime>

Put this section after this tag:

</system.runtime.remoting>

and before the last tag in your App.config:

</configuration>

Just replace name, publicKeyToken and newVersion with your appropriate
values and you should be good to go as long as they do not change the public
interfaces and types.

HTH,
-B

[quoted text, click to view]

Re: Windows service and remoting Ray5531
5/6/2005 12:39:43 AM
Thanks Beth ,
I think it's much better than using remoting ,because in that approach I
have to ask them to make their object inherit from MarshalByRef and change
their configuration file,but in this way I will change my app.
Right??

Thanks for your help

[quoted text, click to view]

Re: Windows service and remoting Beth Massi [Architect MVP]
5/6/2005 9:51:04 AM
Yes you change your App.config file, BUT you still will be using remoting.
You're just telling your application to use the TYPES (metadata) from the
assembly located with your client, but at runtime you will still be
communicating with the remote components. This will work as long as the
public types match in both the server assembly and your client assembly. So
this means that the server component is free to change the implementation
(but NOT the interface), and you will be running the updated implementation
at runtime.

[quoted text, click to view]

AddThis Social Bookmark Button