MSBuild Troubleshooting

I am trying to convert my store from VSS to TFS.

Our current code base consists of a large number of Visual Studio 2008 solutions, and I noticed that some of them seem to cause MSBuild to be lost, but I cannot understand why. The real decisions themselves and the projects that they carry out are built correctly, but the general assembly is still not carried out.

ErrorsAndWarnings.txt and Release.txt are missing errors, just warnings (various little things in the code that we need to clear)

The BuildLog.txt file, of course, is huge and contains tons and tons of difficult to understand text. As far as I can understand it, when it gets into one of these SLN files, which give it problems, MSBuild just flies flat and dies.

Task "MSBuild"
  Global Properties:
    Configuration = Release
    Platform = Any CPU
    OutDir = C: \ TFS \ REPOSITORY \ Full \ Binaries \ Release \
    PublishDir = C: \ TFS \ REPOSITORY \ Full \ Binaries \ Release \
    SkipInvalidConfigurations = true
    RunCodeAnalysis = false
    VCBuildOverride = C: \ TFS \ REPOSITORY \ Full \ Sources \ Code \ Solution \ Solution.sln.Release.vsprops
    VCBuildAdditionalLibPaths =
    VCBuildAdditionalOptions =
    VCBuildToolPath =
    VCBuildUseEnvironment =
    TeamBuildConstants = _TEAM_BUILD_
    TargetsNotLogged = GetTargetPath; GetNativeManifest; GetCopyToOutputDirectoryItems

C: \ Program Files \ MSBuild \ Microsoft \ VisualStudio \ TeamBuild \ Microsoft.TeamFoundation.Build.targets (1008.5): 
error MSB4018: The "MSBuild" task failed unexpectedly.
error MSB4018: System.NullReferenceException: Object reference not set to an instance of an object.
error MSB4018: at Microsoft.Build.BuildEngine.SolutionWrapperProject.AssignDependencyLevel (ProjectInSolution project, SolutionParser solution, Dictionary`2 projectsByDependencyLevel)
error MSB4018: at Microsoft.Build.BuildEngine.SolutionWrapperProject.AssignDependencyLevel (ProjectInSolution project, SolutionParser solution, Dictionary`2 projectsByDependencyLevel)
error MSB4018: at Microsoft.Build.BuildEngine.SolutionWrapperProject.AssignDependencyLevels (SolutionParser solution, Dictionary`2 projectsByDependencyLevel)
error MSB4018: at Microsoft.Build.BuildEngine.SolutionWrapperProject.CreateSolutionProject (SolutionParser solution, Project msbuildProject, BuildEventContext projectBuildEventContext, String wrapperProjectToolsVersion, Engine parentEngine, String solutionProjectCache)
error MSB4018: at Microsoft.Build.BuildEngine.SolutionWrapperProject.Generate (SolutionParser solution, Project msbuildProject, String toolsVersionOverride, BuildEventContext projectBuildEventContext)
error MSB4018: at Microsoft.Build.BuildEngine.Project.Load (String projectFileName, BuildEventContext buildEventContext, ProjectLoadSettings projectLoadSettings)
error MSB4018: at Microsoft.Build.BuildEngine.Engine.GetMatchingProject (Project existingProject, String projectFullPath, BuildPropertyGroup globalPropertiesToUse, String toolsVersion, String [] targetNames, BuildEventContext buildEventContext, Boolean toolsVersionProjectilePeekedfekeked
error MSB4018: at Microsoft.Build.BuildEngine.Engine.BuildProjectFileInternal (BuildRequest buildRequest)
error MSB4018: at Microsoft.Build.BuildEngine.Engine.EngineBuildLoop (BuildRequest terminatingBuildRequest)
error MSB4018: at Microsoft.Build.BuildEngine.TaskExecutionModule.BuildProjectFile (Int32 handleId, String [] projectFileNames, String [] targetNames, IDictionary [] globalPropertiesPerProject, IDictionary [] targetOutputsPerProject, EngineLoggingServices loggingServices, String [] toolsVersions, Boolean useResultsCache, Boolean unloadProjectsOnCompletion , BuildEventContext taskContext)
error MSB4018: at Microsoft.Build.BuildEngine.EngineProxy.BuildProjectFilesInParallel (String [] projectFileNames, String [] targetNames, IDictionary [] globalProperties, IDictionary [] targetOutputsPerProject, String [] toolsVersions, Boolean useResultsCacheloadProlelenOpleplenloadsoolelementleo
error MSB4018: at Microsoft.Build.Tasks.MSBuild.ExecuteTargets (ITaskItem [] projects, Hashtable propertiesTable, ArrayList targetLists, Boolean stopOnFirstFailure, Boolean rebaseOutputs, IBuildEngine2 buildEngine, TaskLoggingHelper log, ArrayList targetOutputs, Boolean useResultsCache, Boolean unloadProjectsOnCompletion, String toolsVersion)
error MSB4018: at Microsoft.Build.Tasks.MSBuild.BuildProjectsInParallel (Hashtable propertiesTable, ArrayList targetLists, Boolean success, Boolean [] skipProjects)
error MSB4018: at Microsoft.Build.Tasks.MSBuild.Execute ()
error MSB4018: at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask (EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean & taskResult)
Done building target "CoreCompileSolution" in project "TFSBuild.proj" - FAILED.
Done Building Project "C: \ TFS \ REPOSITORY \ Full \ BuildType \ TFSBuild.proj" (CompileSolution target (s)) - FAILED.
Done executing task "MSBuild" - FAILED.
Done building target "CoreCompileConfiguration" in project "TFSBuild.proj" - FAILED.
Done Building Project "C: \ TFS \ REPOSITORY \ Full \ BuildType \ TFSBuild.proj" (CompileConfiguration target (s)) - FAILED.
Done executing task "MSBuild" - FAILED.
Done building target "CoreCompile" in project "TFSBuild.proj" - FAILED.
Done Building Project "C: \ TFS \ REPOSITORY \ Full \ BuildType \ TFSBuild.proj" (CoreCompile target (s)) - FAILED.
Done executing task "MSBuild" - FAILED.
Done building target "CallCompile" in project "TFSBuild.proj" - FAILED.

, Qaru , , , MSBuild , , . "Object reference not set...", , , .

, TeamFoundation.Build.targets. , , . ( (1008,5), )

<!-- Build using MSBuild task -->
<MSBuild BuildInParallel="$(BuildSolutionsInParallel)"
         Projects="$(Solution)"
         Properties="Configuration=$(Configuration);Platform=$(Platform);$(OutDirOption);$(PublishDirOption);SkipInvalidConfigurations=$(SkipInvalidConfigurations);$(FxCopDirOption);$(ReferencePathOption);$(CodeAnalysisOption);
                         VCBuildOverride=$(VsPropsFile);VCBuildAdditionalLibPaths=$(VCBuildAdditionalLibPaths);VCBuildAdditionalOptions=$(VCBuildAdditionalOptions);VCBuildToolPath=$(VCBuildToolPath);VCBuildUseEnvironment=$(VCBuildUseEnvironment);
                         TeamBuildConstants=$(TeamBuildConstants);TargetsNotLogged=$(TargetsNotLogged);$(CustomPropertiesForBuild);$(CustomProperties)"
         Targets="$(Targets)"
         StopOnFirstFailure="$(StopOnFirstFailure)">
  <Output TaskParameter="TargetOutputs" ItemName="CompilationOutputs" />
</MSBuild>

, , , node, , , , / .

, MSBuild , , , TeamFoundation.Build.targets, , , .

- ?

+3
4

:

, ,

, IDE "msbuild foo.proj" "msbuild bar.sln"?

, /, TFS , (, "-maxcpucount: 1" ), /. , "-v: diag", MSBuild.

#, MSBuild , Reflector. MSBuild Engine.

+1

, , VS . ( , )

, VS. Dan ( msbuild)

+4

. NullReferenceException, , , . , TFSBuild.proj , ? IE. ,  - Itemgroup.

, Teambuild , , :

, .

0

You can try MSBuild-Sidekicks. They have an excellent debugger for MSBuild, which includes a 14-day trial version: http://www.attrice.info/msbuild/

0
source

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


All Articles