[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: SubWCRev.exe weirdness when used in website .NET project

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Fri, 15 May 2009 20:37:45 +0200

Nick Gilbert wrote:
> Hi,
>
> I have the following command set up as the pre-build event for one of my
> projects so that the revision number is inserted in my version class.
>
> "C:\Program Files\TortoiseSVN\bin\SubWCRev.exe" "$(SolutionDir)\."
> "$(ProjectDir)\General\Version.in.cs" "$(ProjectDir)\General\Version.cs"
>
> However I've noticed that despite this being a PRE build event, I need
> to build TWICE for the correct revision number to be inserted in the
> final binary.
>
> When I build the first time, I get this:
>
> ------ Build started: Project: VBG, Configuration: Debug Any CPU ------
> "C:\Program Files\TortoiseSVN\bin\SubWCRev.exe" "C:\inetpub\wwwroot\cmpdms\\."
> "C:\inetpub\wwwroot\cmpdms\VBG\\General\Version.in.cs" "C:\inetpub\wwwroot\cmpdms\VBG\\General\Version.cs"
> SubWCRev: 'C:\inetpub\wwwroot\cmpdms'
> Last committed at revision 563
> Mixed revision range 561:563
> C:\Windows\Microsoft.NET\Framework\v3.5\Csc.exe etc...
>
> But on the website, it displays version number 562 (ie 1 revision
> behind) until I force another rebuild.
> The version.cs file HAS been correctly updated to 563 BEFORE the
> compiler was called and the new DLL has been copied correctly into the
> website BIN folder (binary identical to the one that was just built in
> the debug/release folder), so how can this possibly still show the OLD
> value? In all other cases, I do not need to build twice to see changes
> I make to my source code - it just seems to be this one value that's out
> of date. If I modify any functions, the changes take effect immediately
> after the first build. This is really weird!
>
> I realise this isn't a problem or bug in TSVN as SubWCRev is working
> perfectly but I thought that perhaps one of you may have come across
> this problem before or perhaps had some insight in to how the website
> build process works within Visual Studio?
>
> Any ideas would be appreciated as this little glitch is really annoying
> me :)

Seems VS doesn't recognize that the version.cs file has been modified?
Does this also happen if you do a rebuild instead of just a build?
Do you have the harddrive write cache enabled?
Maybe adding a sleep() after calling SubWCRev would help?

Just some thoughts about what to try - I don't really know why this
happens...

Stefan

-- 
       ___
  oo  // \\      "De Chelonian Mobile"
 (_,\/ \_/ \     TortoiseSVN
   \ \_/_\_/>    The coolest Interface to (Sub)Version Control
   /_/   \_\     http://tortoisesvn.net
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=2273496
To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].

Received on 2009-05-15 20:38:00 CEST

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.