none
Pre build command that's been working from 2010 - 2015 Update 1 now broken with Update 2

    Question

  • I didn't setup these scripts so I'm kind of in the dark. From what I gather Tortoise SVN reads the assemblyInfo.Template and generates the AssemblyInfo.cs file with the current build versioning information. According to the subwcrev documentation it's a syntax error. I copy paste the command into visual studio's command line and it works just fine. I don't know where to go from here! Here is the error:

    SubWCRev 1.9.0, Build 26652 - 64 Bit
    42> 
    42>  Usage: SubWCRev WorkingCopyPath [SrcVersionFile DstVersionFile] [-nmdf]
    42> 
    42>  Params:
    42>  WorkingCopyPath    :   path to a Subversion working copy.
    42>  SrcVersionFile     :   path to a template file containing keywords.
    42>  DstVersionFile     :   path to save the resulting parsed file.
    42>  -n                 :   if given, then SubWCRev will error if the working
    42>                         copy contains local modifications.
    42>  -N                 :   if given, then SubWCRev will error if the working
    42>                         copy contains unversioned items.
    42>  -m                 :   if given, then SubWCRev will error if the working
    42>                         copy contains mixed revisions.
    42>  -d                 :   if given, then SubWCRev will only do its job if
    42>                         DstVersionFile does not exist.
    42>  -q                 :   if given, then SubWCRev will perform keyword
    42>                         substitution but will not show status on stdout.
    42> 
    42>  -f                 :   if given, then SubWCRev will include the
    42>                         last-committed revision of folders. Default is
    42>                         to use only files to get the revision numbers.
    42>                         this only affects $WCREV$ and $WCDATE$.
    42>  -e                 :   if given, also include dirs which are included
    42>                         with svn:externals, but only if they're from the
    42>                         same repository.
    42>  -E                 :   if given, same as -e, but it ignores the externals
    42>                         with explicit revisions, when the revision range
    42>                         inside of them is only the given explicit revision
    42>                         in the properties. So it doesn't lead to mixed
    42>                         revisions
    42> 
    42>  -x                 :   if given, then SubWCRev will write the revisions
    42>                         numbers in HEX instead of decimal
    42>  -X                 :   if given, then SubWCRev will write the revisions
    42>                         numbers in HEX with '0x' before them
    42>  -F                 :   if given, does not use the .subwcrevignore file
    42> 
    42>  Switches must be given in a single argument, e.g. '-nm' not '-n -m'.
    42> 
    42>  SubWCRev reads the Subversion status of all files in a working copy
    42>  excluding externals. If SrcVersionFile is specified, it is scanned
    42>  for special placeholders of the form "$WCxxx$".
    42>  SrcVersionFile is then copied to DstVersionFile but the placeholders
    42>  are replaced with information about the working copy as follows:
    42> 
    42>  $WCREV$         Highest committed revision number
    42>  $WCREV&$        Highest committed revision number ANDed with the number
    42>                  after the &
    42>  $WCREV+$        Highest committed revision number added with the number
    42>                  after the &
    42>  $WCREV-$        Highest committed revision number subtracted with the
    42>                  number after the &
    42>  $WCDATE$        Date of highest committed revision
    42>  $WCDATE=$       Like $WCDATE$ with an added strftime format after the =
    42>  $WCRANGE$       Update revision range
    42>  $WCURL$         Repository URL of the working copy
    42>  $WCNOW$         Current system date & time
    42>  $WCNOW=$        Like $WCNOW$ with an added strftime format after the =
    42>  $WCLOCKDATE$    Lock date for this item
    42>  $WCLOCKDATE=$   Like $WCLOCKDATE$ with an added strftime format after the =
    42>  $WCLOCKOWNER$   Lock owner for this item
    42>  $WCLOCKCOMMENT$ Lock comment for this item
    42> 
    42> 
    42>  The strftime format strings for $WCxxx=$ must not be longer than 1024
    42>  characters, and must not produce output greater than 1024 characters.
    42> 
    42>  Placeholders of the form "$WCxxx?TrueText:FalseText$" are replaced with
    42>  TrueText if the tested condition is true, and FalseText if false.
    42> 
    42>  $WCMODS$        True if local modifications found
    42>  $WCMIXED$       True if mixed update revisions found
    42>  $WCEXTALLFIXED$ True if all externals are fixed to an explicit revision
    42>  $WCISTAGGED$    True if the repository URL contains the tags classification pattern
    42>  $WCINSVN$       True if the item is versioned
    42>  $WCNEEDSLOCK$   True if the svn:needs-lock property is set
    42>  $WCISLOCKED$    True if the item is locked
    42> 
    42>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1250,5): error MSB3073: The command "subwcrev.exe "C:\Slick OR Projects\gateanalyzer\." “C:\Slick OR Projects\gateanalyzer\Presentation\GatePlanner.Wpf\Properties\AssemblyInfo.template” “C:\Slick OR Projects\gateanalyzer\Presentation\GatePlanner.Wpf\Properties\AssemblyInfo.cs”" exited with code 1.

    This is obviously the command:

    subwcrev.exe "C:\Slick OR Projects\gateanalyzer\." “C:\Slick OR Projects\gateanalyzer\Presentation\GatePlanner.Wpf\Properties\AssemblyInfo.template” “C:\Slick OR Projects\gateanalyzer\Presentation\GatePlanner.Wpf\Properties\AssemblyInfo.cs”"

    Tuesday, May 31, 2016 9:00 PM

Answers

  • Ok figured it out finally!!!  I had to go into the project file itself and modify this line:

    <PropertyGroup>
        <PreBuildEvent>subwcrev.exe &quot;$(SolutionDir).&quot; &quot;$(ProjectDir)Properties\AssemblyInfo.template&quot; &quot;$(ProjectDir)Properties\AssemblyInfo.cs&quot;</PreBuildEvent>
      </PropertyGroup>

    It was using the " character instead of the &quot; escape.  I can't believe Microsoft doesn't do the conversion for you from the project settings page!!!  I have no idea how this works in the previous versions...  There should be a warning of some kind on the page that you should make sure that the text you write gets converted to and from XML!

    • Marked as answer by VasicDev2 Thursday, June 09, 2016 7:14 PM
    Thursday, June 09, 2016 7:13 PM

All replies

  • The shown command contains special quotation marks. Make sure that the commands (which can be found in Project Properties for each of configuration) include simple quotation marks only.

    Wednesday, June 01, 2016 5:05 AM
  • Thank you for your suggestion, but didn't help.  Like I said in the post. The commands have been working for 2.5 years in Visual Studio 2010 and 2015.  The command stopped working when I updated to Visual Studio 2015 Update 2.
    Wednesday, June 01, 2016 5:09 AM
  • Hi VasicDev2,

    Since it works fine before installing Update 2, please try repair your Visual Studio to check whether it can fix this issue.

    And if the problem still exist, please try uninstall the Update 2 to confirm this problem is caused by Update 2.

    In addition, please tell us how you execute this command (use which tool) to help up reproduce this problem in our side. We also test this issue in our side to check whether it is related to machine environment or Update 2.

    Best Regards,
    Weiwei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, June 01, 2016 7:50 AM
    Moderator
  • I tried reinstalling visual studio that already has update 2 in it and still the same problem.  The command is called in the pre build event.  If you go into project properties and look at build events this is where I'm talking about.  I'm assuming the commands are called by visual studio's command line.  If I copy and paste the command that's in the error message into the visual studio command line it works.....  I guess the next step is to create a test app with the same setup and see if I still run into the same issue.   This could take some time...  I have visual studio update 1 on my tablet and it runs just fine from the SVN checkout.  So I know nothing is different between the computers.  Both are fresh pulls from scratch!  The only difference is the hardware and visual studio versions.  I doubt it's the hardware....  Maybe the setup of visual studio is different, but everything was working before the update and now it's not.  So maybe update 2 screwed up a plugin or something....  The only plugin that is required for this command to run is tortoise.  The command is using full paths and the command seems to be recognized.  I'm really confused as to what this could be.
    Wednesday, June 01, 2016 5:32 PM
  • Hi VasicDev2,

    Since you have confirmed this problem occurs just in a Visual Studio with Update 2, I suggest you submit this problem to Visual Studio Connect and then share the feedback link here. It can let other communities who has the same problem to vote and add comments.

    I think the report team experts will treat this problem seriously. If any updates, they will send you email about the process for this issue. Thanks for your feedback for Visual Studio product.

    Best Regards,
    Weiwei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, June 02, 2016 1:21 AM
    Moderator
  • Ok I've reformatted my PC and reinstalled everything...  Now I'm getting a different error which seems to allude to your recommendation, but I don't understand what a simple quotation mark is...  This still doesn't explain why the command works on all my other computers but this one!  This is the new error message:

    5>  File '?C:\SlickOR_Projects\Gates\Common\SlickOR.DialogServices\Properties\AssemblyInfo.template?' does not exist
    5>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1250,5): error MSB3073: The command "subwcrev.exe "C:\SlickOR_Projects\Gates\." “C:\SlickOR_Projects\Gates\Common\SlickOR.DialogServices\Properties\AssemblyInfo.template” “C:\SlickOR_Projects\Gates\Common\SlickOR.DialogServices\Properties\AssemblyInfo.cs”" exited with code 2.

    Wednesday, June 08, 2016 7:55 PM
  • Hi VasicDev2,

    According to your description, this problem is occurs with command for subwcrev.exe in pre build event. Please try another command to check whether this problem just occurs with the subscrev.exe.

    And please create a default project without any custom code and run the command to check whether there has any problem in your project.

    In addition, please provide some detailed information about your machine environment, such as Windows version, hardware space, Memory and so on. And which version of SVN do you use. Please provide the SVN download link and installation tutorials, I will build a VM to emulate your situation to confirm whether this problem is caused by the Update 2.

    Best Regards,
    Weiwei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, June 09, 2016 1:24 AM
    Moderator
  • I've tried the DIR command and it prints out the directory structure just fine.  please see my last post about the new error message WeiWei.  I'm not sure it's update 2.  I tried installing without update 2 and it's got the problem.  It seems no matter how I setup Visual Studio this problem occurs.  I've got to be missing a step in setting up visual studio or something.  It works on everyone's machine but mine.  However, I don't see what could be the problem.  I created a blank WPF project and put the command in the build events and it's failing with the same error as well. I've setup the environment on 3 different computers in the past and none of them have had any trouble.  It just seems to be this computer....  why am I getting File '?C:\SlickOR_Projects\Test\SVNTest\SVNTest\Properties\AssemblyInfo.template?' does not exist?  The file is there!  The path is in quotes and it's right even when I copy past the path into file explorer!  I don't know where the '??' is coming from...


    I have Windows 10 with 6 GB of memory.  I'm using Tortoise SVN 1.9.4.27285 x64.  Visual SVN 5.1.4.  The hardware is irrelevant. 

    Here is a link on how to setup your project to do what I'm doing: http://blog.byteometer.com/subversion-revision-number-in-assemblyinfo-cs/

    Thursday, June 09, 2016 4:31 PM
  • Ok figured it out finally!!!  I had to go into the project file itself and modify this line:

    <PropertyGroup>
        <PreBuildEvent>subwcrev.exe &quot;$(SolutionDir).&quot; &quot;$(ProjectDir)Properties\AssemblyInfo.template&quot; &quot;$(ProjectDir)Properties\AssemblyInfo.cs&quot;</PreBuildEvent>
      </PropertyGroup>

    It was using the " character instead of the &quot; escape.  I can't believe Microsoft doesn't do the conversion for you from the project settings page!!!  I have no idea how this works in the previous versions...  There should be a warning of some kind on the page that you should make sure that the text you write gets converted to and from XML!

    • Marked as answer by VasicDev2 Thursday, June 09, 2016 7:14 PM
    Thursday, June 09, 2016 7:13 PM