2009-08-27 8 views
11

Sto cercando di automatizzare la costruzione di un progetto in Delphi 2009."ERRORE MSB4040 Non v'è alcun obiettivo nel progetto" quando si utilizza msbuild + Delphi2009

sto usando msbuild con .NET 3.5

ho semplicemente chiamano:

Z:\Server>C:\WINDOWS\Microsoft.NET\Framework\v3.5\msbuild "BestSellerAppServer.g 
roupproj" /target:Build 

e ottenere questo:

Build started 27/08/2009 01:15:45 p.m.. 
Project "Z:\Server\BestSellerAppServer.groupproj" on node 0 (Build target(s)). 
Project "Z:\Server\BestSellerAppServer.groupproj" (1) is building "Z:\Server\Be 
stSellerAppServer.dproj" (2) on node 0 (default targets). 
Z:\Server\BestSellerAppServer.dproj : error MSB4040: There is no target in the 
project. 
Done Building Project "Z:\Server\BestSellerAppServer.dproj" (default targets) - 
- FAILED. 

Done Building Project "Z:\Server\BestSellerAppServer.groupproj" (Build target(s 
)) -- FAILED. 


Build FAILED. 

"Z:\Server\BestSellerAppServer.groupproj" (Build target) (1) -> 
"Z:\Server\BestSellerAppServer.dproj" (default target) (2) -> 
    Z:\Server\BestSellerAppServer.dproj : error MSB4040: There is no target in th 
e project. 

    0 Warning(s) 
    1 Error(s) 

Time Elapsed 00:00:00.06 

compilo bene all'interno dell'IDE.

Ho trovato questo http://huwk.blogspot.com/2009/02/msbuild-fails-to-compile-delphi-2009.html ma non risolvere il problema.

risposta

13

C'è un file batch chiamato rsvars.bat (cercarlo nella cartella RAD Studio). Chiamalo prima di chiamare MSBuild e imposterà le variabili d'ambiente necessarie. Assicurati che le cartelle siano corrette in rsvars.bat se hai il compilatore in una posizione diversa rispetto a quella predefinita.

+0

Grazie, questo è il trucco. – mamcx

+0

sì, incluso aggiornare la variabile PATH a MSBuild.exe! – Nashev

5

È stata impostata una variabile di ambiente denominata "BDS", uguale alla cartella RAD Studio?

+1

Sì. Questa è la cosa esatta che deve essere fatta. Grazie! –

Problemi correlati