Need advice on deployment strategy

Need advice on deployment strategy

Old forum URL: forums.lhotka.net/forums/t/5609.aspx


bgilbert posted on Thursday, October 16, 2008

I have a small team (two developers) working on a Click-Once Winforms app. Until recently, the app was set with all DataPortal methods to RunLocal. Now we're configuring a Wcf host to host our library assemblies on an app server and using IIS as the host.

We're struggling to understand how to manage version deployments. With a monolithic app in Click-Once, we could rely on the updater to update everything and could allow the clients to update whenever they wanted. Now, with a relationship between the client's UI and the app server's assemblies, we need to be sure that the upgrades happen concurrently. Is this correct or is there a way to manage version relationships between ui and BO assemblies and maintain multiple versions on the server?

Also, is the process of uploading new versions of the BO assemblies a manual one? Is there someway that VS can manage that process for us?

If you couldn't tell, we're fairly new to this architecture and are stumbling a bit. Any help would be appreciated.

Barry

dlabar replied on Monday, October 20, 2008

I've had similar issues. I was using CSLA to build a Winform that configured a database application in multiple environments. This made things interesting because Winform had a drop down for Dev, QA, Staging, and Production, but each environment could be on a different version of business objects.

I did think about manually managing the ClickOnce Update (Hanselman gives a good explaination http://www.hanselman.com/blog/LearningWPFWithBabySmashManuallyManagingClickOnceAndSomeMoreDesignerGoodness.aspx), but that would be a pain and I wanted the users to have multiple versions installed at the same time.

My solution was to create a small one click program that installed my main program. Since with .Net, there really isn't any thing that has to be installed, all it actually has to do is move files from one place to another. I just had to have each environment report what version it was on, and where the dlls were located for that version.

ajj3085 replied on Tuesday, October 21, 2008

Hi,

I created a Nant script to handle the deployment of the application.  It generates the clickonce manifest in such a way that clients are forced to update; users are not prompted.  The script copies all the click once files to the proper location, and then copies the relevent assemblies to another known location, which is the bin folder for the IIS virtual directory where the remoting portal is being hosted.

Also, I had to build a way into my application to force everyone out at a specified time.  After that time elapses, no one is allowed to connect to the database anymore.  This allows me to be sure people have closed the application and when I re-enable it, they get the latest version (because they are forced to).

If you want to force a certain minimum version, check out the MinimumRequiredVersion of the Deployment manifest.  I also set this to be the version I just deployed.

Andy

bgilbert replied on Tuesday, October 21, 2008

Thanks for your reply. I'm already using the minimum required version property to force updates. My question concerns the time between when I deploy a new version and when the user updates their application. I don't want UI version 1 to be trying to talk with assembly 2 on the server. I also cannot do a force-quit scenario because I don't want to boot people out in the middle of a transaction.

dlabar replied on Tuesday, October 21, 2008

Why don't you create two dataportal endpoints, one would be the current version, and another would be the new.  Update one, while letting users use the other.  On the next update, the current and new dataportal would just switch.

bgilbert replied on Tuesday, October 21, 2008

Hmm. Good suggestion. Back and forth.

Thanks.

ajj3085 replied on Tuesday, October 21, 2008

That only works if it's ok for users to be using your old business rules, and your new versions don't make any assumptions about the data in the system.

Also, consider what happens if you change database schema as part of the upgrade process.  Can your old library and new library cope with that?

ajj3085 replied on Tuesday, October 21, 2008

Oh, just to clarify.  My "lockout" is time dependent, and we have a policy where users will be given at least 15 minutes to finish up what they are doing and close out on their own.  The system also reminds them as the lockout is getting near.

bgilbert replied on Wednesday, October 22, 2008

Andy,

Thanks for your ideas. We have an idle time routine that uses form messages to detect mouse movement or keyboard clicks. Perhaps I could use this to also detect whether someone is in the middle of a transaction. I'm also considering adding a global Dirty flag to the application context to tracks whether any open forms are in a dirty state.

I guess what I was looking for was some was that VS could help me manage versions and deployments. I've seen several techniques that I need to use to help me keep things straight, but I'd like to think there could be some automation tools. Maybe Team System has such things.

Thanks,
Barry

ajj3085 replied on Wednesday, October 22, 2008

Ahh.. I'm not aware of anything in VS, and I've never worked anywhere large enough that used Team System, so I can't tell you if that has what you're looking for or not.

Nant scripts are pretty simple though. 

Post back with your solution, I'd be interested in what others have come up with.

Copyright (c) Marimer LLC