1

I got this error while trying to build a setup of driver project

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"

Any idea about this error?? how solve this??

sigod
  • 3,514
  • 2
  • 21
  • 44
S_b_n_S
  • 77
  • 2
  • 6

2 Answers2

2

Put the path to your file in quotation marks (") to indicate the path is one argument. Since the path contains spaces (between Visual and Studio), the Studio part is considered a new argument and MSBuild doesn't know what to do with it:

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"
Martin Ullrich
  • 94,744
  • 25
  • 252
  • 217
0
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();
}
slfan
  • 8,950
  • 115
  • 65
  • 78