簡體   English   中英

Delphi MSBuild.exe 錯誤 MSB4057 但可以使用 IDE 構建項目

[英]Delphi MSBuild.exe error MSB4057 but can use IDE build project

我在 Windows7 上使用 Delphi XE4 並使用 Microsoft.NET/Framework/V3.5/MSBuild.exe 。

我已將 MSBuild 路徑添加到環境變量中。

但是得到了這個錯誤:(

$MSBuild.exe Project3.dproj /target:Build /property:configutation=Debug
Microsoft (R) Build Engine Version 3.5.30729.5420
[Microsoft .NET Framework, Version 2.0.50727.8762]
Copyright (C) Microsoft Corporation 2007. All rights reserved.

Build started 2017/10/30 ▒W▒▒ 10:45:40.
Project "C:\DXE4_LangDLL\Project3.dproj" on node 0 (Build target(s)).
C:\DXE4_LangDLL\Project3.dproj : error MSB4057: The target "Build" does not exist in the project.
Done Building Project "C:\DXE4_LangDLL\Project3.dproj" (Build target(s)) -- FAILED.

Build FAILED.

"C:\DXE4_LangDLL\Project3.dproj" (Build target) (1) ->
  C:\DXE4_LangDLL\Project3.dproj : error MSB4057: The target "Build" does not exist in the project.

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.00

我嘗試使用 Microsoft.NET/Framework/V2.0.50727/MSBuild.exe 並得到相同的消息。

我很困惑,因為使用 Delphi IDE 成功構建了項目。

有人可以幫助我嗎?

您必須首先設置環境變量。 有一個批處理文件,在路徑

C:\\Program Files (x86)\\Embarcadero\\Studio\\XX\\rsvars.bat

我用於命令行批處理文件,其中 XX 是 RAD Studio 的版本。

我不確定它是否適用於 Git bash,但您可以創建一個批處理文件,將rsvars.bat行和MSBuild行組合起來,然后執行它

類似的東西:

@SET BDS=C:\Program Files (x86)\Embarcadero\Studio\XX
@SET BDSINCLUDE=C:\Program Files (x86)\Embarcadero\Studio\XX\include
@SET BDSCOMMONDIR=C:\Users\Public\Documents\Embarcadero\Studio\XX
@SET FrameworkDir=C:\Windows\Microsoft.NET\Framework\v3.5
@SET FrameworkVersion=v3.5
@SET FrameworkSDKDir=
@SET PATH=%FrameworkDir%;%FrameworkSDKDir%;C:\Program Files (x86)\Embarcadero\Studio\XX\bin;C:\Program Files (x86)\Embarcadero\Studio\XX\bin64;C:\Users\Public\Documents\Embarcadero\InterBase\redist\InterBaseXE3\IDE_spoof;%PATH%
@SET LANGDIR=EN
@SET PLATFORM=
@SET PlatformSDK=

$MSBuild.exe Project3.dproj /target:Build /property:configutation=Debug

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM