VSTS Build defination fails at Get Sources step - build

VSTS Build definition fails at Get Sources step from TFS.
Below is the error:
"error]Microsoft.VisualStudio.Services.Agent.Util.ProcessExitCodeException:
Exit code 1 returned from process: file name 'tf', arguments 'vc get
/version:131 /recursive /overwrite D:\a\3\s /loginType:OAuth
/login:.,*** /noprompt'."
Please help.

You might see this error when the changes that you are trying to check in contain a file/folder to a location that is not mapped to list of sources with the build definition.
Error message is not beautiful enough but it is there to stop accidental check-ins.
Scan through your pending changes and see if there is any file that is from a folder that is not mapped as a source folder in build definition.
If there is one, either add that path to build definition folder list or move the files into a folder that is mapped as source folder.

Close all projects.
2 Connect to your repository.
In pending changes do not filter by any project, just see all files which is it check-in.
Map and check-in files and folders.
Try to build again

Related

What is a Jenkins Workspace directory?

I'm using R scripts with C++ code under the hood. An error message references a Jenkins Workspace with the file I'd like to debug. The workspace directory appears to be temporary and I'm unable to find this file:
c:\jenkins\workspace\mxnet\mxnet\src\operator\tensor../elemwise_op_common.h:123: Check failed: assign(&dattr, (*vec)[i])
How should the directory c:\jenkins\workspace\... be understood?
Where would I look for the header file elemwise_op_common.h?
The file should be in
c:\jenkins\workspace\mxnet\mxnet\src\operator\elemwise_op_common.h
The \../ being for getting one folder up.
The workspace is where Jenkins checks out the sources, and execute its job.
It differs from a build.
See more at "Building a software project".

TFS 2017 Build - Customize the "agent_builddirectory" name

in TFS 2017.2 the agent_builddirectory is a consecutive number. I would like to change it to be the Build Definition Name.
How can I achieve that?
Regards!
No, we cannot customize the “agent_builddirectory” name, unless you reconfigure the agent to change the work folder (create a folder and set the build definition name as the folder name ) before trigger build with the specific build definition.
The alternative way would be create a source folder with the specific build definition name as the folder name on the agent machine.
For example "C:\BuildDefinitionName1" and then add a "Copy Files" task in your build definition to copy the source code from "$(build.sourcesdirectory)" to "C:\BuildDefinitionName1". And then update the settings for other task to run build/test from "C:\BuildDefinitionName1" folder. Make sure to check the "Overwrite" option for "Copy Files" task.
Reference this similar thread: TFS 2015 Build: How to change Agent.BuildDirectory
Most steps of a build execution (e.g. get sources, test assemblies, publish result) are somehow logging their working folder.
By looking at the results of a previously run build you will find out the folder you are looking for.

Cannot compile resource for application manifest in C++ Builder 2006

I am trying to add the application manifest to a program built with C++Builder 2006, by following this article.
(The manifest is to obtain admin rights for my program, which contains "setup" in his name and so it triggers the “This program may not have installed correctly” warning).
I have the MyApp_Setup.exe.manifest in the project folder, along with the MyApp_Setup1.rc file, which is present in the project.
When i try to build, i get:
[RC Fatal Error] MyApp_Setup1.rc(1): File creation failed
What i'm doing wrong, or what should I do?
question edited 'cause i messed up the filenames and the output error didn't matched
Found the problem.
In the project options I always set an "_obj" output folder, but the resource compiler WANTS an existing "debug_build" folder to write the .res file.
It don't create the directory, hence the error in the file creation.
If i remove the "Obj" option, or once you have the "Debug_Build" folder present, everything compiles.

TFS 2010 Solution with multiple dependencies

I am new to build on TFS 2010.
I have 4 C# solutions. One of these solution has a dependency on the assembly produced by each of the other 3 "helper solutions".
I'd like to create a build definition which would build my 3 helper solutions then build the top level solution.
On the build definition dialog I have tried to add each of the 4 solution files to the Workspace tab, with a build agent folder of $(SourceDir) - but I get the error dialog "TF215040: The path $(SourceDir) can only be mapped one time in a given workspace". So I change the mapping for the helper solutions to the build folder used by their respective individual build definition.
On the Process Tab, under the Items to Build property I've added the solution file for each of the 4 solutions, with the parent solution listed last.
When I queue the top level build defintion I get the error message: "The path C:\Builds\3\x.Int.Common\x.Int.Common\Sources is already mapped in workspace xBLD01."
Note: when I run "tf.exe workspaces /owner:*" I notice that my workspaces is listed multiple times, with different owners but the computer name is also the same. I guess this is because there's 3 in the team using the same VM image - they're not connected to the domain. Maybe this is the cause of the problem?
Could anyone please suggest a solution?
Thanks
Rob.
Just map the root folder that contains all 4 solutions under it in the workspace mapping. For example, if your folder structure looks like this:
C:\MyProject\Solution1\1.sln
C:\MyProject\Solution2\2.sln
...
Just map C:\MyProject\ -> $(SourceDir)
If the workspace mappings have gotten messed up on your build server you can download the TFS SideKicks tool to delete all the workspaces on the build server, and the TFS Build will just recreate them proper ones next time you run it.

MsTest: how to set the deployment item relative to either $(ProjectDir) or $(OutDir)

I want to add an deployment item to my test. As far as I understood up until now, the path is relative to the solution. I want the path to be relative to the project. Otherwise, the project can't be used in multiple solutions.
How can I configure the deployment Item to be relative to a project dependent variable?
I was hoping for something like: [DeploymentItem(#"$(ProjectDir)..\..\bin\$(Configuration)")] but I don't find any documentation and it does not seem to work.
I just did a small test. Just plain wizard code and one deployment item:
[TestMethod]
[DeploymentItem("stdafx.cpp")]
void TestMethod1()
{
Assert::Fail();
};
and the trx file shows the following line:
Warning: Test Run deployment issue: Failed to get the file for deployment item 'stdafx.cpp' specified by the test 'TestProject1.UnitTest1.TestMethod1': System.IO.FileNotFoundException: Could not find file 'd:\Development\Projects\deploymentItemTest\stdafx.cpp'.
System.IO.FileNotFoundException: Could not find file 'd:\Development\Projects\deploymentItemTest\stdafx.cpp'.
File name: 'd:\Development\Projects\deploymentItemTest\stdafx.cpp'
which means that "stdafx.cpp" is searched relative to the solution directory (which is in ...\depoymentItemTest) and not the project directory (which is in ...\depolymentItemTest\TestProject1)
I know this is an old question, but my answer may help others.
I was able to solve this problem with two simple steps:
Create the following build event on the test project:
xcopy /I /S /Y "$(TargetDir)*.*" "$(SolutionDir)\bin"
This will copy all the contents (including sub-directories) of the project folder to a folder "bin" relative to the solution.
Add the following DeploymentItem to the test class:
[DeploymentItem ("bin")]
This will copy all the bin contentes to the test folder
This mechanism may be refined (if required) with additional filters both in the build event and the DeploymentItem
Let the test setup copy the file to Environment.CurrentDirectory.