2012-03-01 86 views
1

我有一個Visual Studio 2008解決方案文件和一臺Windows 7(64位)計算機。使用MSBuild命令行實用程序時出錯

我正在嘗試使用MSBuild命令從* .sln文件構建解決方案,但遇到錯誤。

我收到以下錯誤:「MSB4018:在‘ResolveVCProjectOutput’任務失敗意外(在http://connect.microsoft.com/VisualStudio/feedback/details/349531/msb4018-the-resolvevcprojectoutput-task-failed-unexpectedly看到)

使用msbuild.exe修復這個錯誤的64位版本,但帶來了這個。錯誤: MSB3411:無法加載Visual C++組件「VCBuild.exe」

爲了解決這個問題,我補充C:\ Program Files文件(x86)的\微軟的Visual Studio 9.0 \ VC \ vcpackages我路徑

現在,我得到鏈接錯誤和以下警告:

警告MSB3428:無法加載Visual C++組件「VCProjectEngine.dll」

警告MSB3425:未能解析VC項目引用「的東西的.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 

回答

0

「使用64位版本msbuild.exe修正這個錯誤,但是把這個錯誤:MSB3411:無法加載Visual C++組件「VCBuild.exe」「

64位MSBuild無法加載VCBuild.exe,因爲它是32位應用程序。

MsBuild直接構建解決方案有問題嗎?

msbuild SlnFolders.sln /t:build ... 
+0

是的。我的帖子是關於嘗試使用msbuild從命令行直接構建解決方案。 – 2012-03-01 22:04:07

0

剛剛有同樣的問題。我從Framework64目錄%windir%\Microsoft.NET明確運行msbuild。但路徑設置錯了。

運行vcvars64首先解決了這個問題。