Ошибка при использовании утилиты командной строки MSBuild - PullRequest
1 голос
/ 01 марта 2012

У меня есть файл решения Visual Studio 2008 и компьютер под управлением Windows 7 (64-разрядная версия).

Я пытаюсь использовать команду MSBuild для построения решения из файла * .sln, но получаю ошибки.

Я получил следующую ошибку: "MSB4018: Задача ResolveVCProjectOutput неожиданно завершилась ошибкой (при http://connect.microsoft.com/VisualStudio/feedback/details/349531/msb4018-the-resolvevcprojectoutput-task-failed-unexpectedly).

Использование 64-разрядной версии msbuild.exe исправляет эту ошибку, но выдает эту ошибку: MSB3411: не удалось загрузить компонент Visual C ++ «VCBuild.exe»

Чтобы это исправить, я добавил C: \ Program Files (x86) \ Microsoft Visual Studio 9.0 \ VC \ vcpackages в мою PATH.

Теперь я получаю ошибки компоновщика и следующие предупреждения:

предупреждение MSB3428: не удалось загрузить компонент Visual C ++ «VCProjectEngine.dll»

предупреждение MSB3425: не удалось разрешить ссылку на проект VC «thing.vcproj ».

Кроме того, похоже, что проекты не создаются в порядке, указанном в файле .sln.

Теперь я получаю MSB4018: задача ResolveVCProjectOutput неожиданно завершилась ошибкой , снова.

Может ли это быть связано с тем, что 64-битный msbuild.exe вызывает 32-битную DLL? Или это может быть связано с наличием / отсутствием ожидаемых кавычек в каком-либо пути в моих настройках Visual Studio? Или это может быть связано с тем, что проекты строятся не по порядку?



Вот вывод, выдаваемый на диагностическом уровне детализации:

Initial Items:
_SolutionProjectProjects
    ..\SOME_LIB\trunk\msvc_2008\SOME_LIB_LIB.vcproj
    helpers\msvc_2005\helpers.vcproj
    My Sandbox\My Sandbox.vcproj

Building with tools version "2.0".
Target "ValidateSolutionConfiguration: (TargetId:2)" in file "" from project "C:\Users\cmorris\Documents\Projects\My Sandbox\My Sandbox.sln" (entry point):
Task "Error" skipped, due to false condition; (('$(CurrentSolutionConfigurationContents)' == '') and ('$(SkipInvalidConfigurations)' != 'true')) was evaluated as (('<SolutionConfiguration xmlns=""><ProjectConfiguration Project="{A1B06ADE-974B-4B50-A77E-2FB1AC97FFB5}">Debug|Win32</ProjectConfiguration><ProjectConfiguration Project="{28215158-9138-4D90-8B11-461278300EF3}">Debug|Win32</ProjectConfiguration><ProjectConfiguration Project="{3901755B-0BE2-479D-81BE-B98B61BF337F}">Debug|Win32</ProjectConfiguration></SolutionConfiguration>' == '') and ('' != 'true')).
Task "Warning" skipped, due to false condition; (('$(CurrentSolutionConfigurationContents)' == '') and ('$(SkipInvalidConfigurations)' == 'true')) was evaluated as (('<SolutionConfiguration xmlns=""><ProjectConfiguration Project="{A1B06ADE-974B-4B50-A77E-2FB1AC97FFB5}">Debug|Win32</ProjectConfiguration><ProjectConfiguration Project="{28215158-9138-4D90-8B11-461278300EF3}">Debug|Win32</ProjectConfiguration><ProjectConfiguration Project="{3901755B-0BE2-479D-81BE-B98B61BF337F}">Debug|Win32</ProjectConfiguration></SolutionConfiguration>' == '') and ('' == 'true')).
Using "Message" task from assembly "Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "Message" (TaskId:2)
  Building solution configuration "Debug|Win32". (TaskId:2)
Done executing task "Message". (TaskId:2)
Done building target "ValidateSolutionConfiguration" in project "My Sandbox.sln".: (TargetId:2)
Target "ValidateToolsVersions: (TargetId:3)" in file "" from project "C:\Users\cmorris\Documents\Projects\My Sandbox\My Sandbox.sln" (entry point):
Task "Error" skipped, due to false condition; ('$(MSBuildToolsVersion)' == '2.0' and ('$(ProjectToolsVersion)' != '2.0' and '$(ProjectToolsVersion)' != '')) was evaluated as ('3.5' == '2.0' and ('' != '2.0' and '' != '')).
Done building target "ValidateToolsVersions" in project "My Sandbox.sln".: (TargetId:3)
Target "Build: (TargetId:4)" in file "" from project "C:\Users\cmorris\Documents\Projects\My Sandbox\My Sandbox.sln" (entry point):
Task "MSBuild" skipped, due to false condition; (@(BuildLevel0) != '') was evaluated as ( != '').
Task "Message" skipped, due to false condition; (@(SkipLevel0) != '') was evaluated as ( != '').
Task "Warning" skipped, due to false condition; (@(MissingConfigLevel0) != '') was evaluated as ( != '').
Using "CallTarget" task from assembly "Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "CallTarget" (TaskId:3)
Target "helpers: (TargetId:5)" in file "" from project "C:\Users\cmorris\Documents\Projects\My Sandbox\My Sandbox.sln" (target "Build" depends on it):
Task "VCBuild" skipped, due to false condition; ( ('$(Configuration)' == 'Debug_static') and ('$(Platform)' == 'Win32') ) was evaluated as ( ('Debug' == 'Debug_static') and ('Win32' == 'Win32') ).
Using "VCBuild" task from assembly "Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "VCBuild" (TaskId:4)

  Locating vcbuild.exe: Visual C++ Express is not installed on this computer. (TaskId:4)
  Locating vcbuild.exe: falling back to the system PATH variable. (TaskId:4)
  Command: (TaskId:4)
  C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcpackages\VCBuild.exe "C:\Users\cmorris\Documents\Projects\My Sandbox\helpers\msvc_2005\helpers.vcproj" "Debug|Win32"  (TaskId:4)
  The "VCBuild" task is using "VCBuild.exe" from "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcpackages\VCBuild.exe". (TaskId:4)
  Microsoft (R) Visual C++ Project Builder - Command Line Version 9.00.21022 (TaskId:4)
  Copyright (C) Microsoft Corporation. All rights reserved. (TaskId:4)
   (TaskId:4)
  Build started: Project: helpers, Configuration: Debug|Win32 (TaskId:4)
  helpers - up-to-date (TaskId:4)

Done executing task "VCBuild". (TaskId:4)
Task "VCBuild" skipped, due to false condition; ( ('$(Configuration)' == 'Release_static') and ('$(Platform)' == 'Win32') ) was evaluated as ( ('Debug' == 'Release_static') and ('Win32' == 'Win32') ).
Task "VCBuild" skipped, due to false condition; ( ('$(Configuration)' == 'Release') and ('$(Platform)' == 'Win32') ) was evaluated as ( ('Debug' == 'Release') and ('Win32' == 'Win32') ).
Done building target "helpers" in project "My Sandbox.sln".: (TargetId:5)
Target "SOME_LIB_LIB: (TargetId:6)" in file "" from project "C:\Users\cmorris\Documents\Projects\My Sandbox\My Sandbox.sln" (target "Build" depends on it):
Task "VCBuild" skipped, due to false condition; ( ('$(Configuration)' == 'Debug_static') and ('$(Platform)' == 'Win32') ) was evaluated as ( ('Debug' == 'Debug_static') and ('Win32' == 'Win32') ).
Task "VCBuild" (TaskId:5)

  Locating vcbuild.exe: Visual C++ Express is not installed on this computer. (TaskId:5)
  Locating vcbuild.exe: falling back to the system PATH variable. (TaskId:5)
  Command: (TaskId:5)
  C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcpackages\VCBuild.exe "C:\Users\cmorris\Documents\Projects\My Sandbox\..\SOME_LIB\trunk\msvc_2008\SOME_LIB_LIB.vcproj" "Debug|Win32"  (TaskId:5)
  The "VCBuild" task is using "VCBuild.exe" from "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcpackages\VCBuild.exe". (TaskId:5)
  Microsoft (R) Visual C++ Project Builder - Command Line Version 9.00.21022 (TaskId:5)
  Copyright (C) Microsoft Corporation. All rights reserved. (TaskId:5)
   (TaskId:5)
  Build started: Project: SOME_LIB_LIB, Configuration: Debug|Win32 (TaskId:5)
  SOME_LIB_LIB - up-to-date (TaskId:5)

Done executing task "VCBuild". (TaskId:5)
Task "VCBuild" skipped, due to false condition; ( ('$(Configuration)' == 'Release_static') and ('$(Platform)' == 'Win32') ) was evaluated as ( ('Debug' == 'Release_static') and ('Win32' == 'Win32') ).
Task "VCBuild" skipped, due to false condition; ( ('$(Configuration)' == 'Release') and ('$(Platform)' == 'Win32') ) was evaluated as ( ('Debug' == 'Release') and ('Win32' == 'Win32') ).
Done building target "SOME_LIB_LIB" in project "My Sandbox.sln".: (TargetId:6)
Done executing task "CallTarget". (TaskId:3)
Task "MSBuild" skipped, due to false condition; (@(BuildLevel1) != '') was evaluated as ( != '').
Task "Message" skipped, due to false condition; (@(SkipLevel1) != '') was evaluated as ( != '').
Task "Warning" skipped, due to false condition; (@(MissingConfigLevel1) != '') was evaluated as ( != '').
Task "CallTarget" (TaskId:6)
Target "helpers" skipped. Previously built successfully.
Target "SOME_LIB_LIB" skipped. Previously built successfully.
Target "My Sandbox: (TargetId:7)" in file "" from project "C:\Users\cmorris\Documents\Projects\My Sandbox\My Sandbox.sln" (target "Build" depends on it):
Task "ResolveVCProjectOutput" skipped, due to false condition; ( ('$(Configuration)' == 'Debug_static') and ('$(Platform)' == 'Win32') ) was evaluated as ( ('Debug' == 'Debug_static') and ('Win32' == 'Win32') ).
Using "CreateItem" task from assembly "Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "CreateItem" (TaskId:7)
Done executing task "CreateItem". (TaskId:7)
Task "ResolveVCProjectOutput" skipped, due to false condition; ( ('$(Configuration)' == 'Debug_static') and ('$(Platform)' == 'Win32') ) was evaluated as ( ('Debug' == 'Debug_static') and ('Win32' == 'Win32') ).
Task "CreateItem" (TaskId:8)
Done executing task "CreateItem". (TaskId:8)
Task "CreateTemporaryVCProject" skipped, due to false condition; ( ('$(Configuration)' == 'Debug_static') and ('$(Platform)' == 'Win32') ) was evaluated as ( ('Debug' == 'Debug_static') and ('Win32' == 'Win32') ).
Task "VCBuild" skipped, due to false condition; ( ('$(Configuration)' == 'Debug_static') and ('$(Platform)' == 'Win32') ) was evaluated as ( ('Debug' == 'Debug_static') and ('Win32' == 'Win32') ).
Task "Delete" skipped, due to false condition; ( ('$(Configuration)' == 'Debug_static') and ('$(Platform)' == 'Win32') ) was evaluated as ( ('Debug' == 'Debug_static') and ('Win32' == 'Win32') ).
Using "ResolveVCProjectOutput" task from assembly "Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "ResolveVCProjectOutput" (TaskId:9)
  Resolving VC project reference "C:\Users\cmorris\Documents\Projects\My Sandbox\helpers\msvc_2005\helpers.vcproj". (TaskId:9)
MSBUILD : error MSB4018: The "ResolveVCProjectOutput" task failed unexpectedly. [C:\Users\cmorris\Documents\Projects\My Sandbox\My Sandbox.sln]
MSBUILD : error MSB4018: System.ArgumentException: Illegal characters in path. [C:\Users\cmorris\Documents\Projects\My Sandbox\My Sandbox.sln]
MSBUILD : error MSB4018:    at System.IO.Path.CheckInvalidPathChars(String path) [C:\Users\cmorris\Documents\Projects\My Sandbox\My Sandbox.sln]
MSBUILD : error MSB4018:    at System.IO.Path.IsPathRooted(String path) [C:\Users\cmorris\Documents\Projects\My Sandbox\My Sandbox.sln]
MSBUILD : error MSB4018:    at Microsoft.Build.Tasks.ResolveVCProjectOutput.ResolveUsingVCEngineObjectModel(ITaskItem projectRef, String configName, String& resolvedAssemblyPath, String& resolvedImportLibraryPath) [C:\Users\cmorris\Documents\Projects\My Sandbox\My Sandbox.sln]
MSBUILD : error MSB4018:    at Microsoft.Build.Tasks.ResolveVCProjectOutput.Execute() [C:\Users\cmorris\Documents\Projects\My Sandbox\My Sandbox.sln]
MSBUILD : error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [C:\Users\cmorris\Documents\Projects\My Sandbox\My Sandbox.sln]
MSBUILD : error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult) [C:\Users\cmorris\Documents\Projects\My Sandbox\My Sandbox.sln]
Done executing task "ResolveVCProjectOutput" -- FAILED. (TaskId:9)
Done building target "My Sandbox" in project "My Sandbox.sln" -- FAILED.: (TargetId:7)
Done executing task "CallTarget" -- FAILED. (TaskId:6)
Done building target "Build" in project "My Sandbox.sln" -- FAILED.: (TargetId:4)
Done Building Project "C:\Users\cmorris\Documents\Projects\My Sandbox\My Sandbox.sln" (build target(s)) -- FAILED.
Deferred Messages

Detailed Build Summary
======================
     (TaskId:0)

  ============================== Build Hierarchy (IDs represent configurations) =====================================================
  Id                  : Exclusive Time   Total Time   Path (Targets)
  ----------------------------------------------------------------------------------------------------------------------------------- (TaskId:0)
  0                   : 0.944s           0.944s       C:\Users\cmorris\Documents\Projects\My Sandbox\My Sandbox.sln (build)  (TaskId:0)

  ============================== Node Utilization (IDs represent configurations) ====================================================
  Timestamp:            1        Duration   Cumulative
  ----------------------------------------------------------------------------------------------------------------------------------- (TaskId:0)
  634661562995558093:   0        0.944s     0.944s ################## (TaskId:0)
  -----------------------------------------------------------------------------------------------------------------------------------
  Utilization:          100.0    Average Utilization: 100.0 (TaskId:0)

Project Performance Summary:
      943 ms  C:\Users\cmorris\Documents\Projects\My Sandbox\My Sandbox.sln   1 calls
                943 ms  build                                      1 calls

Target Performance Summary:
        0 ms  ValidateToolsVersions                      1 calls
       20 ms  ValidateSolutionConfiguration              1 calls
      149 ms  My Sandbox                                 1 calls
      367 ms  helpers                                    1 calls
      385 ms  SOME_LIB_LIB                                   1 calls
      913 ms  Build                                      1 calls

Task Performance Summary:
        2 ms  CreateItem                                 2 calls
       20 ms  Message                                    1 calls
      146 ms  ResolveVCProjectOutput                     1 calls
      751 ms  VCBuild                                    2 calls
      913 ms  CallTarget                                 2 calls

Build FAILED.

"C:\Users\cmorris\Documents\Projects\My Sandbox\My Sandbox.sln" (build target) (1) ->
(My Sandbox target) -> 
  MSBUILD : error MSB4018: The "ResolveVCProjectOutput" task failed unexpectedly. [C:\Users\cmorris\Documents\Projects\My Sandbox\My Sandbox.sln]
MSBUILD : error MSB4018: System.ArgumentException: Illegal characters in path. [C:\Users\cmorris\Documents\Projects\My Sandbox\My Sandbox.sln]
MSBUILD : error MSB4018:    at System.IO.Path.CheckInvalidPathChars(String path) [C:\Users\cmorris\Documents\Projects\My Sandbox\My Sandbox.sln]
MSBUILD : error MSB4018:    at System.IO.Path.IsPathRooted(String path) [C:\Users\cmorris\Documents\Projects\My Sandbox\My Sandbox.sln]
MSBUILD : error MSB4018:    at Microsoft.Build.Tasks.ResolveVCProjectOutput.ResolveUsingVCEngineObjectModel(ITaskItem projectRef, String configName, String& resolvedAssemblyPath, String& resolvedImportLibraryPath) [C:\Users\cmorris\Documents\Projects\My Sandbox\My Sandbox.sln]
MSBUILD : error MSB4018:    at Microsoft.Build.Tasks.ResolveVCProjectOutput.Execute() [C:\Users\cmorris\Documents\Projects\My Sandbox\My Sandbox.sln]
MSBUILD : error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [C:\Users\cmorris\Documents\Projects\My Sandbox\My Sandbox.sln]
MSBUILD : error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult) [C:\Users\cmorris\Documents\Projects\My Sandbox\My Sandbox.sln]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.97

Ответы [ 2 ]

0 голосов
/ 18 апреля 2013

Просто была такая же проблема.Я явно запускал msbuild из каталога Framework64 %windir%\Microsoft.NET.Но для него были заданы неправильные пути.

Запуск vcvars64 первым решил проблему.

0 голосов
/ 01 марта 2012

"Использование 64-разрядной версии msbuild.exe исправляет эту ошибку, но выдает эту ошибку: MSB3411: Не удалось загрузить компонент Visual C ++« VCBuild.exe ». *

64-разрядная MSBuild не можетЗагрузите VCBuild.exe, потому что это 32-битное приложение.

Является ли проблемой создание вашего решения напрямую с помощью MsBuild ?

msbuild SlnFolders.sln /t:build ...
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...