Build events not honoring multiple command-line arguments

前端 未结 3 1786
梦谈多话
梦谈多话 2021-01-07 09:52

I have the following as my post-build event in a C# .NET 4.0 project in Visual Studio 2010:

call \"$(SolutionDir)Publish\\Publish.exe\" \"$(TargetDir)\" \"\\         


        
3条回答
  •  离开以前
    2021-01-07 10:28

    While working on another project, I actually managed to replicate your problem. I was passing multiple args to a powershell script and found that they were being treated as a single argument. Googling found this link

    http://davidfrette.wordpress.com/2011/01/20/creating-powershell-pre-build-and-post-build-events-for-visual-studio-projects/

    Which has the solution of putting a space at the end of the first parameter i.e. in your example it would be

    call "$(SolutionDir)Publish\Publish.exe" "$(TargetDir) " "\\lithium\c\Photon"
    

    This worked for me so hopefully it will fix your problem.

    If you have more than 2 args then you would need to add a space at the end of each except for the last one.

    HTH

提交回复
热议问题