Wrox Programmer Forums
|
.NET Framework 1.x For discussing versions 1.0 and 1.1 of the Microsoft .NET Framework.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 1.x section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 22nd, 2007, 12:50 AM
Authorized User
 
Join Date: Jan 2004
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
Send a message via Yahoo to adyrotaru
Default Autoupdating webservice

Hi

I need to automatically update a webservice that is already deployed.
That is, when I release a new version of webservice, I want the
webservice to automatically update itself.
To accomplish that, I use a webmethod to transfer a zipped file
containing all the files needed (binary files + some xml files, etc).
After the transfer is done, I try to launch a new process (console
application) that will actually copy the files inside the zipped
archive over the existing ones. The problem is that I can't manage to
launch the process.
Everytime the process is launched by the webservice method, I get the
following error (read from event viewer):

"The description for Event ID ( 0 ) in Source ( .NET Runtime ) cannot
be found. The local computer may not have the necessary registry
information or message DLL files to display messages from a remote
computer. You may be able to use the /AUXSOURCE= flag to retrieve this
description; see Help and Support for details. The following
information is part of the event: .NET Runtime version 1.1.4322.2032-
ERPUpdater.exe - Strong name validation failed.: Strong name
validation failed for assembly 'E:\ikon\ERP\ERPUpdater\bin\Debug
\ERPUpdater.exe'. The file may have been tampered with or it was
partially signed but not fully signed with the correct private key"

It's strange because the exe HAS strong name. I used "sn" utility.
Furthermore, before launching the process, I use impersonation to gain
enough rights to execute the process and to copy the files (i'm using
an administrative account).
I event "played" with UseShellExecute, UseShellExecute and
RedirectStandardOutput flags of the ProcessStartInfo instance.
When running the process from anywhere else, all works fine.

Any ideas?
Thanks


__________________
smile... tomorrow will be better
 
Old April 23rd, 2007, 07:23 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I would imagine this is going to be a problematic solution. You are trying to call a process that updates (overwrites) the assembly that is calling the process. I just got a mental image of a cartoon hand erasing itself from the elbow down.

This is a web service you are updating. Why can't you just FTP the files to the server it's running on? That would be easiest.

-Peter
 
Old April 23rd, 2007, 12:31 PM
Authorized User
 
Join Date: Jan 2004
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
Send a message via Yahoo to adyrotaru
Default

Hi, thanks for posting.
1. FTP transfer means more traffic and more possible problems, e.g. partial updates
2. Why and how the "child" process relies on the process that started it?


 
Old April 23rd, 2007, 01:24 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Any process involving the file system could result in a partial update.

How large of a web service application is this that you are worried about more traffic?

I would think that you might run into problems when you have a process updating the DLLs that hold the program that started that process. When you overwrite the web service DLLs, IIS will reset the application. This may cause a disruption in the update process because the process is being executed by the web service that is being reset.

It just seems to me that you are over complicating things. If you *can* use FTP, why not? Is your intent to create a completely automated system that does this?

-Peter
 
Old April 23rd, 2007, 02:54 PM
Authorized User
 
Join Date: Jan 2004
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
Send a message via Yahoo to adyrotaru
Default

Hi
Thanks again.
I know about the implications (resetting the app).
Yes, my intent is to enable the webservice to autoupdate itself.
Imagine my situation:
I have this ws that is consumed by many client apps.
A deployment process means installing the ws plus many client apps to the customer's site.
The ws and client app is constantly developping, so I had this (original?) idea: from my development desk I could create 2 zip files: one containing the ws's updated files, the other contains the new client app. Now, to minimize the customer's intervention, I thought I could send the 2 files to my customer. Using an admin tool, he may send the 2 files to the webservice. The ws, using a logic, will send the updates to the client apps and also update itself and everybody will be happy. This was my idilic idea :) still digging for it

 
Old April 23rd, 2007, 03:25 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

If you used the 2.0 framework, you could publish the client application to a web location and the apps would automatically update themselves. The web service update would be another store. Why is the client updating the web service? Why aren't you updating the web service?

-Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
to know Webservice vingo_mail ASP.NET 2.0 Basics 1 March 3rd, 2008 01:16 PM
Help me about WebService hueduongit .NET Web Services 2 June 3rd, 2004 09:51 PM
webservice hanuyedluri .NET Web Services 1 March 21st, 2004 05:16 PM
Properties of WebService sakalou J2EE 0 February 3rd, 2004 02:08 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.