【发布时间】:2020-03-11 06:29:29
【问题描述】:
string CandlePath = "C:\\Program Files (x86)\\WiX Toolset v3.11\\bin\\candle.exe";
string BundlePath = "C:\\Solution Directory\\Bundle.wxs";
string wixObjPathToSave = "C:\\Solution Directory\\Bundle.wxs";
ProcessStartInfo processStartInfo = new ProcessStartInfo("cmd.exe");
processStartInfo.WindowStyle = ProcessWindowStyle.Normal;
processStartInfo.Arguments ="/k \"" + candlePath + "\" " +BundlePath + " " +wixObjPathToSave;
当我像上面一样传递参数时,进程正在接受参数,但 candle.exe 给出错误“C:\Solution”不被识别为内部或外部命令,这是预期的,因为我没有为 bundlePath 和 wixobjPathToSave 提供双引号
processStartInfo.Arguments ="/k \"" + candlePath + "\" \"" +BundlePath + "\" \"" + wixObjPathToSave +"\"";
当我像上面一样传递参数时,该过程会给出错误,即“C:\Program”不被识别为内部或外部命令。
我做错了什么?
【问题讨论】:
-
在上面的代码中sn -p string wixobjPathToSave="C:\\Solution Directory\\Bundle.wixobj";
标签: c# process.start wix3.11