MSBUILD 命令行编译的时候请注意msbuild文件名称或路经中空格导致出错

在使用MSBUILD 去编译msbuild文件的时候,如果这个方案或者项目的名称或者路经中间有空格符号,需要把这个方案或者项目整个用引号引起来,否则编译的时候会出错.
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\msbuild E:\K2 Workflow\TcmWorkflow-PurchasingContractApproval-Deployment\Deployment\TcmWorkflow.msbuild /p:Environment=Production

这时候在控制台窗口会报错:

C:\Documents and Settings\geffzhang>c:\WINDOWS\Microsoft.NET\Framework\v2.0.5072
7\msbuild E:\K2 Workflow\TcmWorkflow-PurchasingContractApproval-Deployment\Deplo
yment\TcmWorkflow.msbuild /p:Environment=Production
Microsoft (R) Build Engine Version 2.0.50727.3053
[Microsoft .NET Framework, Version 2.0.50727.3082]
Copyright (C) Microsoft Corporation 2005. All rights reserved.

MSBUILD : error MSB1008: Only one project can be specified.
Switch: Workflow\TcmWorkflow-PurchasingContractApproval-Deployment\Deployment\Tc
mWorkflow.msbuild

For switch syntax, type "MSBuild /help"
正确的形式应该是这样的:c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\msbuild “E:\K2Workflow\TcmWorkflow-PurchasingContractApproval-Deployment\Deployment\TcmWorkflow.msbuild” /p:Environment=Production
C:\Documents and Settings\geffzhang>c:\WINDOWS\Microsoft.NET\Framework\v2.0.5072
7\msbuild E:\K2Workflow\TcmWorkflow-PurchasingContractApproval-Deployment\Deploy
ment\TcmWorkflow.msbuild /p:Environment=Production
Microsoft (R) Build Engine Version 2.0.50727.3053
[Microsoft .NET Framework, Version 2.0.50727.3082]
Copyright (C) Microsoft Corporation 2005. All rights reserved.

Build started 2009-8-10 19:07:27.
__________________________________________________
Project "E:\K2Workflow\TcmWorkflow-PurchasingContractApproval-Deployment\Deploym
ent\TcmWorkflow.msbuild" (default targets):

Target Deploy Processes:
    __________________________________________________
    Project "E:\K2Workflow\TcmWorkflow-PurchasingContractApproval-Deployment\Dep
loyment\TcmWorkflow.msbuild" is building "E:\K2Workflow\TcmWorkflow-PurchasingCo
ntractApproval-Deployment\Deployment\TcmWorkflow.msbuild" (InitDeploy target(s))
:

    Deploy Processes: Task Started (2009-8-10 19:07:28)
    Adding Process : TcmWorkflow\PurchasingContractApproval
    Deploy Process: Task Completed (2009-8-10 19:07:32)
Target Create Notifications:
    Notification Service: Task Started (2009-8-10 19:07:32)
                 Server Connection: Try and Open oa-cherry:5555
                 Server Connection: Connected to oa-cherry:5555
                 Notification(s):
                 Server Connection: Try and Close Any Open Connections to oa-che
rry:5555
                 Server Connection: Done Closing Any Open Connections to oa-cher
ry:5555

                 Summary:
                         Notifications Added to Worklist:   0
                         Notifications Deleted to Worklist: 18
    Notification Service: Task Completed (2009-8-10 19:07:33)
Target Create Workflow Reporting Smart Objects:
    Workflow Reporting Service: Task Started (2009-8-10 19:07:33)
         Server Connection:
           Management Server Connection: Try and Open Connection oa-cherry : 555
5
           Management Server Connection: Connected to oa-cherry : 5555
         Get Existing SmartObjects for Service Item Instance.
         Perform GUID integrity check to ensure SmartObjects can be published.
         Service Instance: Try and Get Service Instance from Guid ef7310e5-b14f-
464d-b0f3-a37d6c367620
         Service Instance: Created Service Instance from Guid ef7310e5-b14f-464d
-b0f3-a37d6c367620
         SmartObject to Create/Update: Rpt_TcmWorkflow_PurchasingContractApprova
l
           Extend Object:
             Try and Create Extend Object (Service Instance Extender Type:proces
s)
             Created Extend Object (Service Instance Extender Type: process)
             Set Property AssistCount_Int32_ProcDataField
             Set Property LawyerAssistCount_Int32_ProcDataField
             Set Property VPCount_Int32_ProcDataField
             Set Property AreaManagerLimit_Double_ProcDataField
             Set Property ManagerLimit_Double_ProcDataField
             Set Property EVPLimit_Double_ProcDataField
             Set Property CEOLimit_Double_ProcDataField
             Set Property TotalApproveAmount_Double_ProcDataField
             Set Property CategoryDepartmentId_Int64_ProcDataField
             Set Property CategoryDepartmentName_String_ProcDataField
             Set Property ContractDepartmentId_Int64_ProcDataField
             Set Property ContractDepartmentName_String_ProcDataField
             Set Property IsAd_Int32_ProcDataField
             Set Property IsArea_Int32_ProcDataField
             Set Property IsNeedCEOApproval_Int32_ProcDataField
             Set Property IsPurchase_Int32_ProcDataField
             Set Property IsWarrant_Int32_ProcDataField
             Set Property AssistList_String_ProcDataField
             Set Property AreaManagerList_String_ProcDataField
             Set Property BusinessGroupList_String_ProcDataField
             Set Property CEOReturnToList_String_ProcDataField
             Set Property CFOList_String_ProcDataField
             Set Property CMTList_String_ProcDataField
             Set Property DepartmentManagerList_String_ProcDataField
             Set Property EVPList_String_ProcDataField
             Set Property LawyerAssistList_String_ProcDataField
             Set Property ArchiveStaffList_String_ProcDataField
             Set Property StampStaffList_String_ProcDataField
             Set Property VPList_String_ProcDataField
             Set Property DataScope_String_ProcDataField
             Set Property IsStandard_Int32_ProcDataField
             Set Property IsImportant_Int32_ProcDataField
             Set Property LawyerList_String_ProcDataField
             Set Property SubmitCount_Int32_ProcDataField
             Set Property ContractId_String_ProcDataField
             Set Property ContractNo_String_ProcDataField
             Set Property SystemId_Int32_ProcDataField
             Set Property AssignToCount_Int32_ProcDataField
             Set Property AssignToList_String_ProcDataField
             Set Property DefaultAssistCount_Int32_ProcDataField
             Set Property ReviewUrl_String_ProcDataField
           SmartObject Definition:
             Try and Create SmartObject Definition for the Extend Object
             Created SmartObject Definition for the Extend Object
             SmartObject Associations
             SmartObject Default Methods
               Read Method: None Specified
               List Method: None Specified
               Report Method: None Specified
             Category Path: Workflow Reports\Workflow Solutions\TcmWorkflow\Purc
hasingContractApproval
             Adding SmartObjectDefinition to Package with following GUID: 62a534
79-045c-42e8-801a-6c552f89134b
           Publish:
             Trying to Publish Package to Server.
             Done Publish Package to Server.
         Server Disconnection:
           Management Server Connection: Try and Close Any Open Connection to oa
-cherry : 5555
           Management Server Connection: Done Closing Any Open Connection to oa-
cherry : 5555
         SmartObjects Created:
    Workflow Reporting Service: Task Completed (2009-8-10 19:07:34)

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:06.40

你可能感兴趣的:(Build)