-1

I am using msbuild to build setup and in there when following line of code hit there will be an error

    <!-- Add mappings to the workspace -->
<Exec Command="$(TfCommand) workfold /map /workspace:$(WorkSpaceName) /server:$(ServerName) $(SourceControlMainDirectory-Customizations) $(SolutionRoot-Customizations)" WorkingDirectory="$(SolutionRoot-Customizations)" ContinueOnError="false" />

Error is

"D:\Mubasher Net Plus - Asia\Branches\FeaturesDevelopment_R5\Build\Scripts\IndonesiaDT5-XOPO\Build-IndonesiaDT.proj" (default target) (1) ->

(Get-Latest target) -> D:\Mubasher Net Plus - Asia\Branches\FeaturesDevelopment_R5\Build\Scripts\Get-Latest-IndonesiaDT.proj(52,5): error MSB3073: The command ""C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\tf.exe " workfold /map /workspace:FeaturesDevelopment_R5 /server:http://192.0.0.0:8080/tfs/defaultcollection $/Mubasher Net Plus - Asia\Branches\FeaturesDevelopment_R5\Customizations" D:\MS_BUILD\MTECH\Branches\Fe aturesDevelopment_R5\Customizations" exited with code 100. [D:\Mubasher Net Plus - Asia\Branches\FeaturesDevelopment_R5\Build\Scripts\IndonesiaDT5-XOPO\Build-IndonesiaDT.proj]

 <SolutionRoot-Customizations>D:\MS_BUILD\MTECH\Branches\FeaturesDevelopment_R5\Customizations</SolutionRoot-Customizations>
<SourceControlMainDirectory-Customizations>$/Mubasher Net Plus - Asia\Branches\FeaturesDevelopment_R5\Customizations"</SourceControlMainDirectory-Customizations>
<ServerName>http://192.0.0.0:8080/tfs/defaultcollection</ServerName>
<TfCommand>"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\tf.exe"</TfCommand>
<WorkspaceName>FeaturesDevelopment_R5</WorkspaceName>

How to overcome this?

Prageeth Liyanage
  • 1,612
  • 2
  • 19
  • 41
  • [Exit with code 100](https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2010/ms194959(v=vs.100)?redirectedfrom=MSDN) means nothing succeeded. You can see [this page](https://learn.microsoft.com/en-us/azure/devops/repos/tfvc/workfold-command?view=azure-devops) about the TF Command – Jingmiao Xu-MSFT Aug 25 '22 at 03:12

1 Answers1

0

The tf command line is not correct. When using the /map switch the server folder and local folder should be provided after the switch and before any other options.

Running the command

tf vc help workfold

Shows the following syntax

tf vc workfold /map serverfolder localfolder
               [/collection:TeamProjectCollectionUrl]
               [/workspace:workspacename]
               [/login:username,[password]]

Try the following instead. Note in addition to rearranging the options and arguments, I have also added quotes around the file paths.

<Exec Command="$(TfCommand) workfold /map &quot;$(SourceControlMainDirectory-Customizations)&quot; &quot;$(SolutionRoot-Customizations)&quot; /workspace:$(WorkSpaceName) /server:$(ServerName)"
  WorkingDirectory="$(SolutionRoot-Customizations)"
  ContinueOnError="false" />
Jonathan Dodds
  • 2,654
  • 1
  • 10
  • 14