I’ve created the following simple msbuild project file, but the output is quite weird (see Message tag result).
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Upload" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<DirectoryToUpload>Directory\</DirectoryToUpload>
<RemoteServer>my.remote.server.com</RemoteServer>
</PropertyGroup>
<Target Name="Upload">
<Message Text="Uploading from directory ${DirectoryToUpload} to server ${RemoteServer}" />
</Target>
</Project>
And the output.
D:\Project\Source>C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe ftpupload.proj /target:Upload
Microsoft (R) Build Engine Version 4.0.30319.1
[Microsoft .NET Framework, Version 4.0.30319.239]
Copyright (C) Microsoft Corporation 2007. All rights reserved.
Build started 11/19/2011 4:22:28 PM.
Project "D:\Project\Source\ftpupload.proj" on node 1 (Upload target(s)).
Upload:
Uploading from directory ${DirectoryToUpload} to server ${RemoteServer}
Done Building Project "D:\Project\Source\ftpupload.proj" (Upload target(s)).
Why MSbuild shows property name, but not it’s value?
P.S. The whole thing is running under TeamCity, but it makes no difference who starts the msbuild.exe, the result is always the same.
That property syntax is incorrect. The correct syntax should be with parenthesis: