Team Building Project Failed to start MSBuild.exe. Illegal characters on the way

I am trying to build a project in a team. It will perform a TFS check and the files will be locally on the build server. If I manually run the build command on the server, it works:

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\msbuild.exe C:\TeamCity\buildAgent\work\3446a5bd436eea87\Dev\Dev\project\myproj\myproj.csproj /t:build 

In Teamcity, I have an MSBuild build step:

build path: Dev \ Dev \ project \ myproj \ myproj.csproj "the working directory is left empty mbuild version: microsoft.net framework 4.0 msbuild toolsversion: 4.0 working platform: X86 Objectives: I tried to build the" assembly "and left the command line parameters empty empty

if I create a command line build task and run the above command line, it works. I'm not sure what the differences are between the command line and the msbuild task in teammcity.

EDIT

I tried several working directory options:

The exit path in the project is set to. \ Build \ Tools \ myproj \

So, I installed the working directory in teamcity: Dev \ Dev \ project \ Build \ Tools \ myproj \

It did not help.

Here is the exact output from teamcity:

 Starting: C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.MsBuildBootstrap.exe /workdir:C:\TeamCity\buildAgent\work\3446a5bd436eea87\Dev\Dev\project\Build\Tools\myproj /msbuildPath:C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe in directory: C:\TeamCity\buildAgent\work\3446a5bd436eea87\Dev\Dev\project\Build\Tools\myproj Failed to start MSBuild.exe. Illegal characters in path. System.ArgumentException: Illegal characters in path. at System.IO.Path.CheckInvalidPathChars(String path) at System.IO.Path.IsPathRooted(String path) at JetBrains.TeamCity.Utils.FileUtil.MakeFullPath(String path, String workDir) in c:\BuildAgent\work\c2314fd21f15dc97\src\Utils\src\FileUtil.cs:line 48 at JetBrains.BuildServer.MSBuildBootstrap.RunArgs.get_ProjectFile() in c:\BuildAgent\work\c2314fd21f15dc97\src\MSBuildBootstrap\src\RunArgs.cs:line 156 at JetBrains.BuildServer.MSBuildBootstrap.Impl.MSBuildBootstrapFactory.Create(IClientRunArgs args) in c:\BuildAgent\work\c2314fd21f15dc97\src\MSBuildBootstrap.Core\src\Impl\MSBuildBootstrapFact ory.cs:line 29 at JetBrains.BuildServer.MSBuildBootstrap.Program.Run(String[] _args) in c:\BuildAgent\work\c2314fd21f15dc97\src\MSBuildBootstrap\src\Program.cs:line 67 
+7
source share
4 answers

Try editing the assembly configuration and remove the quotation marks from the Create file options.

If you have:

"Dev \ Dev \ Project \ MYPROJ \ myproj.csproj"

Just let me:

Dev \ Dev \ Project \ MYPROJ \ myproj.csproj

I hope this help.

+1
source

In TeamCity, when you use parameters for your path or part of a path, it’s easy to insert it into a folder and not notice that it has a new line or a carriage return (as I found from painful experience). It can be displayed in TeamCity as a parameter value:

\ Folder1 \ NewlyPastedInFolder \ ExistingFolder \ BuildScripts

What looks like a word-wrapped meaning is actually a parameter with a carriage return in the middle. Check it out by editing it and see if you can delete the character to make it single-line.

+1
source

This question seems very similar:

What is the illegal character on this line? I get MSBUILD: error MSB3095

In addition to this question, take a look at:

What is the dll.refresh file in ASP.Net?

On this question, this answer is of interest:

In an ASP.NET project, adding a file-based link will add .refresh in the Bin folder. When the project is under source, this file is then added to the source control. * .dll.refresh files that put the bin directory. Each time you add an external link, you will find the dll.refresh file next to it. These dll.refresh files are an exception to the rule, and they should go to source management. This is the only way your web project will know where its links live.

If you do not have this in source control, this may explain the problem you are seeing. It seems that the error message is potentially misleading, and this is because the link is not resolving on the build machine.

Regarding why it works from the command line, is it possible that when you build TeamCity, it cleans the output directory before building? If, when launched from the command line, the binaries were already removed from the partially unsuccessful assembly referenced by the file links, this will be successful.

To determine if this is true: if you do a completely clean check and then run the MSBuild step from the command line, does it still succeed?

0
source

I came across this error message from TeamCity, and it turned out that the reason was a space in the solution file (the solution file referenced in the Visual Studio assembly steps contained double quotes, and this did not seem to help. Perhaps this were those quotes that blew it up?). I suppose there is some way to handle the space, but it was easier to just rename the solution file without a space, and this solved the problem.

0
source

Source: https://habr.com/ru/post/911851/


All Articles