Sijin
Sijin

Reputation: 4550

Use subversion for asp.net deployment - Causes appdomain recycle

I am experimenting with using subversion to deploy updates to my ASP.Net application, one issue that I am facing is that whenever the working copy(containing the build) is updated the ".svn" folder inside of bin gets updated and this causes the ASP.Net appdomain to recycle. I don't want this to happen unless something in bin has actually changed.

Is there a way to tell ASP.Net to ignore the ".svn" folder inside of bin? Basically not watch that folder for changes?

If this does not work out, I'll be using a staging folder outside the web folders to download the builds onto the servers and then use scripts to patch/update the actual web folders.

[Edit:] The svn export option will not keep my deployment under version control, I want to be able to do "svn update" on the web folders to deploy and rollback releases.

Upvotes: 2

Views: 1557

Answers (7)

user32117
user32117

Reputation:

I'm a little late to the game but I'll throw my 2 cents:

You can use svn export passing a -r REV param. This enables you to rollback your app to the specified revision.

So you can use:

svn export REPOSITORY DESTINATION --force to update to HEAD (current state of you application)

or

svn export REPOSITORY -r REV DESTINATION --force to update to an other revision (maybe you should be using tags)

Don´t forget the --force param so it can replace the existing files in DESTINATION.

Upvotes: 0

David d C e Freitas
David d C e Freitas

Reputation: 7521

Subversion 1.7 and up doesn't create .svn files in each subdirectory anymore which makes it possible to do what you want without the .svn files getting in the way.

Upvotes: 0

Hades
Hades

Reputation: 1985

Have you thought about using a Continuous Integration server?

Continuous Integration basically refers to a development practice designed to increase the frequency of commits to the repository.

The more often you commit the better granularity you have over rollbacks and also the less that can be broken between commits.

The tools listed below all work with subversion and can be combined with MSBuild on the server to produce an automated build & deployment system.

MSBuild directives include the option to ignore certain files (i.e. code behind) when copying to live directory. In addition, some files you may want to have a development version and a live version... in this case we should write a "transform" script for MSBuild which just makes sure that the file is correct for the live server when copying live. (i.e. web.config)

Hudson - http://java.net/projects/hudson/

Draco - http://draconet.sourceforge.net/

CruiseControl - http://cruisecontrol.sourceforge.net/

Upvotes: 1

D'Arcy Rittich
D'Arcy Rittich

Reputation: 171559

An app pool recycle should not be that big a deal. Is your issue perhaps that your users are losing their session when this happens? If so, switch to StateServer or SQLServer sessions instead of using InProc.

Upvotes: 0

MarkR
MarkR

Reputation: 63616

You probably want to add the "Bin" directory to your svn:ignore list; it should not be committed anyway as it contains compiled code, not source code.

In any case as your final deployment "svn export" is probably a better choice, as others have noted.

Upvotes: 1

Espo
Espo

Reputation: 41939

If you use svn export instead of svn checkout to get the files from your repository you will not get the .svn folder on your server.

[Edit] Another option would be to delete "bin" from your repository (and possibly commit it to another one, if you need revisions), and then just copy the bin-catalog to your webroot manually when it changes. Remember to add "bin" to your svn-ignore-list.

Upvotes: 5

Ray Booysen
Ray Booysen

Reputation: 30041

Well unfortunately if you do this, then you will, as you're experiencing, an AppDomain restart. So unless you do as Espo has said and use svn export, you'll see this issue.

Would it be easier to write a 2 line batch file that svn updates a local copy and then copies the files across?

Upvotes: 0

Related Questions