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 / November 2003

Tip: Looking for answers? Try searching our database.

Updater Application Block

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
liam - 03 Nov 2003 17:30 GMT
Hi,

I am trying to write a Windows Service which uses the Updater
Application block.

The service works fine until I try and include a Post Processor.  When
I include this the windows service seems to get a handle on the file
it is downloading and then refuses to ever let go of it.

The service continues to poll and download new versions of the file
but it always executes the Post Processer from the original file.

Any help or ideas on this would be appreciated.

liam
Rune Huseby - 04 Nov 2003 07:12 GMT
liamfinnie@yahoo.co.uk (liam) wrote in news:562dd1b2.0311030930.118525e9
@posting.google.com:

> I am trying to write a Windows Service which uses the Updater
> Application block.

Just did the same, a service that updates itself.

> The service works fine until I try and include a Post Processor.  When
> I include this the windows service seems to get a handle on the file
> it is downloading and then refuses to ever let go of it.

Are you restarting the service after the download? There is something about
loaded assemblies cannot be unloaded in .NET. A workaround would be to
create a new AppDomain that host the UAB, and restart the AppDomain after
each successful download.

Would be nice if you could post something if you figure out the problem as
we soon will use a Post Processor too.  

Signature

Rune Huseby
(Removing '2' from the e-mail adress will greatly increase your chance of
reaching me)

Liam Finnie - 14 Nov 2003 17:50 GMT
Well,

I couldn't get the Post Processor to work using a windows service.  Time
was tight so I ended up using a scheduled console app.

My problem was:

Three windows services:
Service A - does some work
Service B - does some work
Service C - is the updater

When Service C identifies that a new version of one of the worker
services is available it downloads it into a download folder.  The Post
Processor then stops the relevant service, copies in the new code, and
then restarts the service.

This seems to work fine the first time.  However the Updater service
seems to keep a handle on the file that it has originally downloaded and
never lets go.  So when another version becomes available it downloads
ok but the version that it copies into the new directory is the first
version!  And therefore it also executes the Post Processor from the
first version.

If you found a way around this I would appreciate it if you could
enlighten me.  You originally mentioned using a differnet App Domain but
I can't seem to find a way to do that either.

regards,
Rune Huseby - 17 Nov 2003 18:09 GMT
> Well,

[...]

> If you found a way around this I would appreciate it if you could
> enlighten me.  You originally mentioned using a differnet App Domain
> but I can't seem to find a way to do that either.

Instead of letting the PostProcessor do the copying, launch an exe from the
PostProcesser that stops all services, including Service C, copies files,
than restarts all services.

Signature

Rune Huseby
(Removing '2' from the e-mail adress will greatly increase your chance
of reaching me)


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.