visual-studio-2010command-lineexcel-2007oneclick

Visual Studio OneClick publish from command line isn't generating proper directory structure


Problem Trying to publish an Excel 2007 Addin from the command line produces unexpected directory names/directory structure when trying to set the PublishDir property.

What I'm doing I'm trying to publish an Excel 2007 addin via the command line. I have set everything up in the project and when I publish it from Visual Studio everything works perfectly. I can also publish from the commandline with the following and it also works perfectly:

msbuild /t:publish /p:Configuration=release

However, as soon as I add the PublishDir property then things go all batty:

msbuild /t:publish /p:Configuration=release;PublishDir="C:\ExcelAddin\Publish"

When I either publish from Visual Studio or do not specify PublishDir then the files are put into a directory and everything looks like this:

This is the expected (and working) file structure

When I specify PublishDir="C:\ExcelAddin\Publish" then this is what C:\ExcelAddin looks like.
This is the unexpected (and not working) file structure

Can anyone point me in the right direction?


Solution

  • When specifying the PublishDir property, you need to include the trailing \. If the trailing back slash isn't present, then the directories are smashed together and nothing seems to work correctly. I believe this should work:

    msbuild /t:publish /p:Configuration=release;PublishDir="C:\ExcelAddin\Publish\"
    

    I found a reference to this while looking at http://msdn.microsoft.com/en-us/library/ff624126.aspx