Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a situation to build multiple solution using MSBUILD in multi threading, but during build, always few solution get failed. I have try to build each solution one by one , its working perfectly. but i have try to build 5 solution using multi threading, few build get failed. As I investigated the build log file of both success build and failure build, it seems MSBUILD getting conflict with each build process. For reference I have attached two text file of build log.

Build start for submission ID 11468

Build start for submission ID 11468

string SolutionPath = System.IO.Directory.GetFiles(SolutionFolder, "*.sln").FirstOrDefault();
                WriteLog("A", TimeStartExecute.ElapsedMilliseconds.ToString(), string.Format("Build solution name {0}", SolutionPath));
                ProjectCollection pc = new ProjectCollection();
                Dictionary GlobalProperty = new Dictionary();
                GlobalProperty.Add("Configuration", appConfiguration);
                GlobalProperty.Add("Platform", appPlatform);
                //GlobalProperty.Add("Platform", "x86");
                GlobalProperty.Add("OutputPath", appOutputPath);
                GlobalProperty.Add("VisualStudioVersion", appVSVersion);
                GlobalProperty.Add("BuildInParallel", "true");
                GlobalProperty.Add("maxcpucount", "2");
                BuildParameters bp = new BuildParameters(pc);
                 

                if (appBuildLogger.Equals("true"))
                {
                    bp.Loggers = new[]
                    {
                        new FileLogger
                        {
                        Verbosity = LoggerVerbosity.Detailed,
                        ShowSummary = true,
                        SkipProjectStartedText = true,
                        Parameters=@"Logfile="+SolutionFolder+"\\build.log"
                        }
                    };
                }
 using (BuildManager objBuildManager = new BuildManager())
 {
 BuildRequestData BuildRequest = new BuildRequestData(SolutionPath, GlobalProperty, "14.0", new string[]
 { "Build" }, null,
    BuildRequestDataFlags.ReplaceExistingProjectInstance);
    BuildResult buildResult = objBuildManager.Build(bp, BuildRequest)
 if (buildResult.OverallResult == BuildResultCode.Success)
 {
  buildPath = Convert.ToString(buildResult.ResultsByTarget.FirstOrDefault(x =>
x.Key == "Build").Value.Items[0]);
 }
}


What I have tried:

After investigation found the problem in build process by build log..

Success build log https://github.com/Microsoft/msbuild/files/1115978/11468.success.txt

failure build log https://github.com/Microsoft/msbuild/files/1115979/11468.failed.txt
Posted
Updated 30-Jun-17 9:03am
v2

1 solution

In failed.txt I can see that MsBuild has problems finding CopyArray_Test and searches in lot of places until it finds one that you probably did not intend.
So make sure you have got your paths right, and maybe doing a Rebuild will help too.
 
Share this answer
 
Comments
Arun Vasu 30-Jun-17 15:36pm    
Thanks for your quick reply.

You can see both text file.. initially it's taking correct path of solution, this will change only after finishing few steps.. You can see that in this image..
https://i.stack.imgur.com/KbaJb.png

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900