For those using Visual Studio 2012 and the new publish configuration file (Properties/PublishProfiles/Local.pubxml
) you can use this syntax in the file itself:
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<SiteUrlToLaunchAfterPublish />
<publishUrl>$(MSBuildThisFileDirectory)..\..\obj\publish</publishUrl>
<DeleteExistingFiles>True</DeleteExistingFiles>
</PropertyGroup>
</Project>
Be aware that the $(MSBuildThisFileDirectory) property will resolve to the Local.pubxml directory. From there you should traverse up to get where you need to be.