Title: Message
None of that happens automatically.  ASP.NET manages this for web apps.  The .NET Framework has the ability to do this for other apps as well, but you have to write some code to make it happen when you create a new appdomain.  By default, .NET assembly DLLs are locked while the process/appdomain is running.


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, August 15, 2003 1:04 PM
To: [EMAIL PROTECTED]
Subject: RE: [Nant-users] Deployment

Eric,
 
It is my understanding (and I have seen this in action for web applications) that .NET never runs your assembly (.exe or .dll) directly but rather makes a copy of it to a temp directory and runs that (no file locking).  It then creates a filewatcher to check the original assembly to see if it ever changes ... if it does then .NET will unload the appdomain and reload it with the changed assembly.  This allows you to seemlessly deploy upgrades using a simply file copy without worrying about unloading your application first.  I believe the process for copying the assemblies for execution is known as shadow copy.
 
I just tested changing a .exe for a .NET service on my PC that is running and it allowed me to do it.  So it must be doing shadow copy to a temp file for services too.  I will have to test further to determine if changes to the .exe result in the service being reloaded on the fly ...
 
Anyone with more information or if my description is incorrect then please chime in! :-)
 
Regards,
Jonathan Cogley
-----Original Message-----
From: Eric Fetzer [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 14, 2003 5:55 PM
To: Cogley, Jonathan; [EMAIL PROTECTED]
Subject: RE: [Nant-users] Deployment

Based on the environment, I think the answer is yes.  But I think even with the NAnt approach, if you're using services, you have to shut them down and start them up.  This isn't a good question for me because I'm just entering the scene.
 
Janathan - can you explain what you mean by a shadow copy?
 
Thanks,
Eric

[EMAIL PROTECTED] wrote:
A question about MSI file deployment ...
 
Don't you have downtime while you install the MSI if you are upgrading an application?  Wouldn't a simple nant build script be better since it will take advantage of shadow copy and avoid downtime?
 
TIA,
Jonathan Cogley
-----Original Message-----
From: Eric Fetzer [mailto:[EMAIL PROTECTED]
Sent: Monday, August 11, 2003 5:57 PM
To: Peter Lanoie; Nant Users
Subject: RE: [Nant-users] Deployment

Thanks Peter, Clayton, and Jason for your responses.  I really appreciate the support this user group gives and hope I can do the same in the future.
 
I figured out the COM dll stuff earlier.  Services are my main concerns.  We have 2 different servers we are deploying to, web and batch.  The Web side is less complicated, we can just do copies over there.  On the batch side, though, we have several projects running as services which is why the developers feel strongly about the msi approach.  It deals with the service for you.  I'll paste my conversation with the Microsoft guy (I felt fobbed off [sp?]).  My question:
 

I've got the build process automated using NAnt. I plan to ride CruiseControl.NET on top of it to perform automated builds to an integrated environment (tested with NUnit as a part of the build process) as things are checked into VSS. I'm starting to think in terms of stage and deploy to qa/prod.

Up to this point, this group has used setup projects to create MSI files . Seems unnecessary to me maintaining all of these extra projects in order to deploy stuff. I found a .NET Framework tool called installutil.exe that will uninstall and install apps from the command line. I brought it up to the developer who does the builds now, and he is concerned that it won't be smart enough to deal with services. I doubt it is, but am thinking it would be sufficient to just do:

net stop serviceName
installutil /uninstall myApp.exe
copy in executables...
installutil myApp.exe
net start serviceName


Another alternative is to use the <msi> task in NAnt. Here's an example:
<msi debug="true" license="MyLicense.rtf"
output="MyProduct.msi" sourcedir="${mysource.dir}"
banner="MyBannerImage.bmp" background="">
<properties>
<property name="ProductName" value="My Product" />
<property name="ProductVersion" value="1.0.0.1" />
<property name="Manufacturer" value="My Company" />
<property name="ProductCode" value="[Generate a GUID here]" />
<property name="UpgradeCode" value="[Generate a second GUID here]" />
</properties>
<features>
<feature name="DefaultFeature" title="My Product" display="2">
<description>My Product wants to be Installed!</description>
</feature>
</features>
<components>
<component name="MyProductFiles" id="[Generate a third GUID here]" attr="2">
<directory ref="MyProductFolder" />
<feature ref="DefaultFeature" />
<key file="MyProduct.exe" />
</component>
</components>
<directories>
<directory name="MyProductFolder" foldername="MyProduct" root="ProgramFilesFolder" />
</directories>
</msi>

What really throws me about using this task in NAnt though, is the GUID. I've found a way to gather the ProductCode dynamically with VB:

MsgBox AppName.ProductCode
But I've found no info on gathering the UpgradeCode. I would appreciate any suggestion concerning my automation direction. Also, I wanted see what you thought about the OpenMake build tool.

His reply:
 
Hi guys.  If I remember correctly, services need to be installed using installutil anyway (whether done manually from the command line or automatically by the MSI installer) so you could do it that way.  However, I’m a big fan of using an MSI file for deployment into all environments (dev, QA, staging, and production) as there are less moving parts.  Ideally, the entire project can be delivered using a single MSI file – sounds like you have many MSIs?

My response to his response:

This would be ideal.  For this app, though, it would have to be 2 MSI's (2 different boxes with different components - web vs. batch type stuff).  I guess my questions are born of ignorance.  I have VERY little experience with .NET (about a month).  I've learned enough to be able to automate the build itself with NAnt (get latest from VSS, compile successfully...).  So now I've got a bunch of .exe's, .dll's, ascx's...  I'm looking for a way to take that stuff and deploy (i.e. create something that can be staged and deployed at a later point).  In researching, it looks like there are several ways to do this.  The MSI file seems the best.  I would think it ideal to create these two files dynamically rather than storing under source control as to allow project growth without another element to keep in sync.  Do you have any advice for this type of deployment?  On the NAnt user forum, some have indicated that this kind of thing could be done with devenv.exe.  I haven't found the literature overly helpful thus far.

His response to my response to his response:
 
I’d recommend investing some time familiarizing yourself with the setup and deployment projects – they are pretty powerful.  I believe there’s a good walkthough in the VS docs.  If you want a brain dump, give me a ring on the cell # below and I’d be happy to help.  I’d store the setup projects in source control.
After this response, it became painfully obvious to me that I was asking a rabbit about groundhogs.  Any help?  Thanks again - Eric

Peter Lanoie <[EMAIL PROTECTED]> wrote:
Eric,
 
I have been working with a somewhat complex deployment system so could provide many tidbits if asked the right questions.  Normally, you should simply be able to deploy a web project by copying all the pages (as?x) and the dlls from the bin\ folder of the project to your destination server.  You shouldn't need more than that.  However, you can run into some problems depending on how complicated your system(s) are or whatever special cases you have (don't we all have those).  The only thing I can think of without knowing more about your particular configuration is that you need to watch out for the 3rd party DLLs.  If you have a 3rd party DLL in your project, Visual Studio automatically copies it into that project's bin\ folder when you reference it.  You'll have to make sure that you do that step when you build with NAnt.  (When you reference a COM DLL Visual Studio will create the Interop DLL and drop it in the bin\ so you needn't worry about that one.)
 
Can you provide more detail about what you found to be "not that easy"?  What specifically are you having problems with? 
 
Peter
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Eric Fetzer
Sent: Monday, August 11, 2003 15:12
To: Nant Users
Subject: [Nant-users] Deployment

Any advice on deployment?  I have NAnt doing builds for me, compiling about 25 projects.  There are 2 separate boxes being deployed to.  One side is the web side and the other batch.  So I have a master build file calling 2 other build files and then the Master does a copy to a staging area.  Originally I was thinking I could just take all of the resulting files (.exe, .dll, .as?x...) to the appropriate directory on the system to be run on.  Well, I realized that it's not that easy (go figure).  The Microsoft guy is telling me that it would be best to maintain setup projects created using Visual Studio.  I was hoping to automate the deployment so that it wouldn't be necessary to always keep these sync'd up with their corresponding project files, the master solution...  Seems like a lot of redundancy going on and possibilities of losing synchronicity.  I would appreciate any tidbits of wisdom you could give.  Thanks - Eric


Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!


> ATTACHMENT part 2 application/x-pkcs7-signature name=smime.p7s


Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!

Reply via email to