【问题标题】:MSBUILD : error MSB1008: Only one project can be specified while make setup fileMSBUILD : 错误 MSB1008: 制作安装文件时只能指定一个项目
【发布时间】:2017-10-25 16:27:50
【问题描述】:
我在尝试构建驱动程序项目设置时遇到此错误
C:\Program Files (x86)\Microsoft Visual Studio 14.0>msbuild /t:clean /t:build C:\Users\iomadmin\Documents\Visual Studio 2015\Projects\KMDF\KMDF Driver5\KMDF Driver5.sln /p:Configuration="Debug" /p:Platform=Win32 /p:TargetVersion="Windows10" /p:TargetPlatformVersion="10.0.10010.0"
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.
MSBUILD : error MSB1008: Only one project can be specified.
Switch: Studio
For switch syntax, type "MSBuild /help"
关于这个错误的任何想法?这个怎么解决??
【问题讨论】:
标签:
visual-studio
msbuild
kmdf
【解决方案1】:
将文件路径放在引号中 (") 以表明路径是一个参数。由于路径包含空格(在Visual 和Studio 之间),Studio 部分被认为是一个新参数,MSBuild 不知道如何处理它:
msbuild /t:clean /t:build "C:\Users\iomadmin\Documents\Visual Studio 2015\Projects\KMDF\KMDF Driver5\KMDF Driver5.sln" /p:Configuration="Debug" /p:Platform=Win32 /p:TargetVersion="Windows10" /p:TargetPlatformVersion="10.0.10010.0"
【解决方案2】:
private void GetExeFile(string link)
{
Process compiler = new Process();
compiler.StartInfo.FileName =@"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe";
compiler.StartInfo.Arguments = link + @"C:\Users\khan\Documents\Visual Studio 2012\Projects\Calculator\Calculator.sln /t:build /r:System.dll /out:sample.exe stdstr.cs";
compiler.StartInfo.UseShellExecute = false;
compiler.StartInfo.RedirectStandardOutput = true;
compiler.Start();
txtGetContent.Text = compiler.StandardOutput.ReadToEnd();
compiler.WaitForExit();
}