Warning: Declaration of LJXP_Walker_Category_Checklist::start_lvl(&$output, $depth, $args) should be compatible with Walker::start_lvl(&$output, $depth = 0, $args = Array) in /home/victorsergienko/victorsergienko.com/wp-content/plugins/lj-xp/lj-xp-options.php on line 796

Warning: Declaration of LJXP_Walker_Category_Checklist::end_lvl(&$output, $depth, $args) should be compatible with Walker::end_lvl(&$output, $depth = 0, $args = Array) in /home/victorsergienko/victorsergienko.com/wp-content/plugins/lj-xp/lj-xp-options.php on line 796

Warning: Declaration of LJXP_Walker_Category_Checklist::start_el(&$output, $category, $depth, $args) should be compatible with Walker::start_el(&$output, $object, $depth = 0, $args = Array, $current_object_id = 0) in /home/victorsergienko/victorsergienko.com/wp-content/plugins/lj-xp/lj-xp-options.php on line 796

Warning: Declaration of LJXP_Walker_Category_Checklist::end_el(&$output, $category, $depth, $args) should be compatible with Walker::end_el(&$output, $object, $depth = 0, $args = Array) in /home/victorsergienko/victorsergienko.com/wp-content/plugins/lj-xp/lj-xp-options.php on line 796

Warning: Cannot modify header information - headers already sent by (output started at /home/victorsergienko/victorsergienko.com/wp-content/plugins/lj-xp/lj-xp-options.php:796) in /home/victorsergienko/victorsergienko.com/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 60
code name / MSBuild don’ts
Skip to content

MSBuild don’ts


A couple of notes how NOT to use MSBuild.

  1. Don’t generate files with AssemblyInfo task. It screws comments, screws InternalsVisibleTo attributes, and whatever else it doesn’t account for.
    Instead
    : Use
    <FileUpdate Files="@(AssemblyInfoFiles)"
    Regex="AssemblyVersion\(".*?"\)\]"
    ReplacementText="AssemblyVersion("$(Major).$(Minor).$(Build).$(Revision)")]"
    />
    <FileUpdate Files="@(AssemblyInfoFiles)"
    Regex="AssemblyFileVersion\(".*?"\)\]"
    ReplacementText="AssemblyFileVersion("$(Major).$(Minor).$(Build).$(Revision)")]"
    />
  2. Don’t account for TfsXXXX community tasks – it won’t run on VS 2008 with Team Explorer 9.0.
    Instead:  Use <Exec Command=”tf …”>.
    And if you have domain authentication in TFS and don’t run integration under domain user (which happens), you even can’t run tf in cmd-line mode: stupid authentication dialog will pop up.
  3. Do not use local files to store version number. You will lose them when moving build to another host, so use only source control-dependent files.
    Might seem evident, but strange how many people miss this.
    So you’ll need to
    <Attrib Files="version.txt" Normal="true" />
  4. Per Scott Colestock’s post, “since TfsVersion interrogates the build server’s workspace, and BuildNumberOverrideTarget comes early in the process… you might find that you don’t get the changeset number you expect”.
  5. Don’t try to operate on XML node collections with tasks other then Xslt.
    For instance, XmlRead returns a Nodeset only as a string of “;”-joined
    Node.Value-s.
    XmlQuery supports Values property, though I wasn’t able to operate it’s results.
    Instead you can use ReadLinesFromFile (sadly, this will trim the lines).
    My personal choice for not-too-complex XML is… you can guess… yes, FileUpdate.
  6. Don’t use FtpUpload. It won’t create folders for you.
    Just <Exec> a ftp…
    By the way, Windows’ ftp.exe client is unable to upload in passive mode. You can download passively, if you issue “LITERAL PASV“, but it won’t help the client.

Post a Comment

Your email is never published nor shared.