24

I am trying to test automated builds in tfs/vs.net 2012. I have set the workpaths in the source control explorer but now I am getting an error:

Exception Message: There is no working folder mapping for $/testing/buildtest. (type ItemNotMappedException)

enter image description here

user603007
  • 11,416
  • 39
  • 104
  • 168

5 Answers5

34

I had the same problem. Turned out I had forgotten to expand the Items to Build section of the Process tab. To fix you need to:

  • Edit build definition
  • Open Process tab on left
  • Open the 1. Required section

    • open up Items to Build
    • ensure the Projects to Build is pointed to the correct .sln

Edit build definition screen

Ruskin
  • 5,721
  • 4
  • 45
  • 62
  • 1
    In the `Projects to Build` field, select (using the `...` button) the solution `.sln` file that you want to target. – Ruskin Mar 04 '16 at 12:00
8

You need to map the root of the team project (in your case "testing) which is not done. enter image description here

The local path should be "c:\dev\testing\buildtest".

How is your BuilDefinition setup?

Khh
  • 2,521
  • 1
  • 25
  • 42
2

In my case clicking on the Build Agent Folder (...) button revealed that the $(SourceDir) wasn't set, indicating the mapping was broken.

enter image description here

Matthew
  • 1,630
  • 1
  • 14
  • 19
1

This can also happen if you forget to include your parent folder of the source code in the Source Settings in the build definition.

 $/Source/Code/ParentOfSolution

Working folders basically creates a white list of files for the build to look at and use so it needs to contain your source code that is referenced by your sln and any DLL's that your code references.

Paul Totzke
  • 1,470
  • 17
  • 33
0

In my case the exception message "There is no working folder mapping for xxx." was thrown at Microsoft.TeamFoundation.VersionControl.Client.Client.GetLocalWorkspace(String localPath, Boolean throwIfNotFound) out of my own code:

var changesets = myRealTfsServer.QueryHistory( path, versionSpec, 0, RecursionType.Full, null,  new ChangesetVersionSpec( 1 ), versionSpec, 2, true, true, false, false );

My solution is to use the TFS path '$/' to specify the path parameter, which is actually not as declared in this page in MSDN which says this path should be a local path.

Cary
  • 372
  • 1
  • 5
  • 14