2012-03-01 91 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首先解决了这个问题。