tags:

views:

14

answers:

1

I have an asp.net mvc application that I am publishing with Publish feature of Visual Studio and I have a custom MSBuild task that needs the directory that I am publishing to so it knows where to copy some custom build files to... I've tried $(OutDir), $(PublishDirectory) and a bunch of others... how do I get this path?

A: 

You should be able to use the PackageArchiveRootDir property to resolve that. The default value for that is obj\Debug\Package. So if you need the full path you just combine the MSBuildProjectDirectory with the PackageArchiveRootDir like: $(MSBuildProjectDirectory)\$(PackageArchiveRootDir).

Sayed Ibrahim Hashimi