我正在尝试在构建完成后对构建输出进行一些自定义处理。
通常,我们有一个执行以下操作的批处理文件:
... do stuff first ...
msbuild /m /p:Configuration=Release "C:\Path\To\File\No\Whitespace\MySolution.sln"
... do more stuff...
这可行。
现在尝试处理输出,我已经完成了以下操作
... do stuff first ...
SETLOCAL ENABLEDELAYEDEXPANSION
SET count=1
FOR /F "tokens=* USEBACKQ" %%F IN (`msbuild /m /p:Configuration=Release "C:\Path\To\File\No\Whitespace\MySolution.sln"`) DO (
ECHO %%F
)
ENDLOCAL
... do more stuff ...
但是这将输出以下内容:
Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
MSBUILD : error MSB1008: Only one project can be specified.
Switch: C:\Path\To\File\No\Whitespace\MySolution.sln
For switch syntax, type "MSBuild /help"
我尝试按照其他SO答案中所示从路径中删除引号,但没有运气。如何成功运行msbuild并遍历输出?