none
MSBuild issue on windows server 2012 LINK1327 mt.exe error c1010070 RRS feed

  • Question

  • We have a C++ application using MFC. We also use the manifest that is auto generated and we actually do use it.

    The environment is windows server 2012 it has TFS 2018 installed on it and a build agent configured. Visual studio 2017 pro 15.6.2 is also installed with all the needed packages for our project.

    The weird thing is when i compile the project within visual studio everything is build just fine BUT when i build with the build agent on the same machine there is an error: 

    Generating code

    All 26621 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.

    Finished generating code

     

    C:\_TFS(0,0): Error c1010070: Failed to load and parse the manifest. The system cannot find the file specified.

    C:\_TFS : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified. [C:\_TFS Build Agents\DEUSRV52\_work\1\s\test\App\HC100\HC100.vcxproj]

     

    LINK(0,0): Error LNK1327: failure during running mt.exe

    LINK : fatal error LNK1327: failure during running mt.exe [C:\_TFS Build Agents\DEUSRV52\_work\1\s\test\App\HC100\HC100.vcxproj]

    Done Building Project "C:\_TFS Build Agents\DEUSRV52\_work\1\s\test\App\HC100\HC100.vcxproj" (default targets) -- FAILED.

    Done Building Project "C:\_TFS Build Agents\DEUSRV52\_work\1\s\test\App\HC100.sln" (default targets) -- FAILED.

    Build FAILED.

    "C:\_TFS Build Agents\DEUSRV52\_work\1\s\test\App\HC100.sln" (default target) (1) ->

    "C:\_TFS Build Agents\DEUSRV52\_work\1\s\test\App\HC100\HC100.vcxproj" (default target) (4) ->

    (Link target) ->

      C:\_TFS : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified. [C:\_TFS Build Agents\DEUSRV52\_work\1\s\test\App\HC100\HC100.vcxproj]

      LINK : fatal error LNK1327: failure during running mt.exe [C:\_TFS Build Agents\DEUSRV52\_work\1\s\test\App\HC100\HC100.vcxproj]

        0 Warning(s)

        2 Error(s)

    Time Elapsed 00:02:11.68

    Process 'msbuild.exe' exited with code '1'.

    Now it says that a certain file cannot be found except that the file is actually there. My guess is that something else might be wrong here.

    So I went to the folder where the sources are being placed via the get sources task which is in the agents folder structure and I then opened the solution with visual studio and build it there and again within visual studio the build is successful.

    I've been looking on the internet and I found a couple of solutions such as:

    1. disable manifest creation in the linker options menu... (this is not a solution for us since we need it)
    2. mt.exe can't cope with spaces in the file path (strange since when opening the same files in visual studio it does built or is there something different when opening it from VS or building it with an agent?)
    3. Digital Guardian might restrict execution (we don't have that nor can i see it in procmon)
    4. A virus scanner might block execution (nothing is installed only windows defender is running)

    I'm pretty sure that it has nothing to do with points 3 and 4 (virus scanners/ security restrictions) since I can build it successfully within visual studio itself.

    I just started to use TFS build for the first time so there is a big chance that i'm missing something here. Hopefully someone can help me out.

    Friday, March 16, 2018 1:16 PM

All replies

  • Hi S-t-e-v-en,

    Welcome to MSDN forum.

    According to the error log, it seems HC100.vcxproj could not be found when you build with TFS, could you make sure if that file exists in the path:

    C:\_TFS Build Agents\DEUSRV52\_work\1\s\test\App\HC100\
     

    If the file HC100.vcxproj not exists in that path, you should add this file into the source control. If the file HC100.vcxproj exists in the that path, then you should check if your tfs build definition source settings is correct.

    Since you can compile the project within visual studio successfully on the same machine, so this issue should not related to your project or MSBuild, be more related to TFS, so, if above not help you, I suggest that you can open a new thread on the stackoverflow with TFS tag, more community members and MVP on that forum may further look at your issue and provide more suggestions.

    Thanks for your understanding and cooperation.


    MSDN Community Support Please remember to click Mark as Answer. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Monday, March 19, 2018 8:56 AM
  • Hi Leo Liu-MSFT,

    Thank you for your reply.

    The file exists in that exact path and the folders under the C:\_TFS Build Agents\DEUSRV52\_work\1\s\ are already coming from TFS because of the get sources step in my build definition. 

    I tested the get sources step by doing the following:

    I removed all the project folders and then ran the build definition again. all the folders and project files are back as well as the .vcxproj file that it seems not to find. So what I did next was to open the solution file directly in this folders structure (that it got via TFS get sources step) ran it with visual studio and again it builds just fine.

    So my guess is that it has something to do with parameters that i have to give to msbuild. I also tried building the project using the "build with visual studio" build step (since its installed on the system) and this also generates the same errors... So i think it is very likely that I am missing some parameters that msbuild and even the build with visual studio build step needs in order for it to be executed. 

    I'll post this questions on stackoverflow too.

    Thanks again.

    Friday, March 23, 2018 7:33 AM
  • The issue is found and we have a workaround implemented.

    When an Agent is defined in a path that has spaces in it mt.exe will not be able to find a file within that path. But this gets stranger because when you have a path that contains spaces and you run msbuild.exe via the command line mt.exe will find the path and the build is successful. after some testing we found out that if you combine the execution on an agent (which is located in a path that has spaces) the execution of mt.exe by the agent will have this error that mt.exe is not able to find the file. Now to completely test this and to make 100% sure that this has something to do with the agents path I created a build definition with specific execution paths. So I disabled the get sources step, removed all the sources then placed all the sources in a space free path and then ran the msbuild commands on an agent that contains spaces in its path and then it failed again.

    So what we settled for is to locate our agents in a path that does not contain any spaces and now it builds just fine.

    Wednesday, April 18, 2018 7:40 AM