msbuild -p:outputdir=c:\mydir being ignored

后端 未结 4 896
星月不相逢
星月不相逢 2021-02-03 17:05

I\'m running msbuild from the command line with the following:

msbuild mysolution.sln -p:outputdir=c:\\mydir

When I run this, the outputdir is

4条回答
  •  花落未央
    2021-02-03 17:46

    Note that OutputPath is preferred over OutDir. The documentation used to be wrong about this, but I see that they've finally fixed it.

    Beyond that, it's difficult to say exactly what the problem is, since you didn't show the exact path that you're passing as a parameter. There are two possible problems that I can imagine:

    1. The OutputPath option specifies the path to the output directory relative to the project directory. That means you can't set it to a global path like C:\mydir. I assume it is unable to find the path you specified, and so it defaults to the one specified in your project file.

    2. If the path that you're actually specifying as a parameter contains spaces, the command is likely to fail. I believe you need to wrap the path in quotes and append an extra backslash to the end of the path string.

提交回复
热议问题