0

A .NET project I've worked on, has encountered a build error recently. The project had no issues building previously, and this error persists over several development machines I've tried. I've seen similar, but not identical posts in my search, which suggested editing the build commands. How do you edit the build commands for a project, and is there an obvious issue with this xcopy command?

Since the solution has last been built, there have not been any changes. I simply needed to update licensing on several ComponentOne components. I've reverted to the previously built version, which now has the same error. Are there any changes I could have inadvertently made that may have caused an issue?

xcopy C:\Subversion Code\Subversion\Mrw\trunk\MrwMeasureApp\MrwReports C:\Subversion    Code\Subversion\Mrw\trunk\MrwMeasureApp\bin\Debug\MrwReports\ /Y
Invalid number of parameters
c:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(3397,13): error MSB3073: The command "xcopy C:\Subversion Code\Subversion\Mrw\trunk\MrwMeasureApp\MrwReports C:\Subversion Code\Subversion\Mrw\trunk\MrwMeasureApp\bin\Debug\MrwReports\ /Y" exited with code 4.
Done building project "MrwMeasureApp.vbproj" -- FAILED.

Thanks in advance for any insight.

Corey
  • 398
  • 1
  • 4
  • 18

2 Answers2

2

You should wrap your parameters in quotations, like so.

xcopy
   "C:\Subversion Code\Subversion\Mrw\trunk\MrwMeasureApp\MrwReports"
   "C:\Subversion Code\Subversion\Mrw\trunk\MrwMeasureApp\bin\Debug\MrwReports\"
   /Y

Lines broken only for visibility.

J. Steen
  • 15,470
  • 15
  • 56
  • 63
  • Thanks, I just noticed there was a space in "Subversion Code", renaming the folder to "SubversionCode" allows the build. For future reference however, how can you add quotations to the build commands in Visual Studio 2008? – Corey Jun 27 '12 at 14:09
  • Nope, automatically called through visual studio. Should I just be sure to avoid spaces in project folders from this point forward? – Corey Jun 27 '12 at 14:11
  • 1
    Hum. As far as I'm aware (though I won't swear by it, haven't worked with 2008 for about two years) the automatic build events should always properly escape and wrap parameters. I.e., you shouldn't NEED to avoid spaces - but in this case, until you find the cause, maybe you should. =) – J. Steen Jun 27 '12 at 14:12
2

You should quote path parameters:

xcopy "C:\Subversion Code\Subversion\Mrw\trunk\MrwMeasureApp\MrwReports" "C:\Subversion Code\Subversion\Mrw\trunk\MrwMeasureApp\bin\Debug\MrwReports\" /Y
Dmitry Egorenkov
  • 1,045
  • 8
  • 19
  • Thanks, I noticed there was a space in "Subversion Code", renaming the folder to "SubversionCode" allows the build. For future reference however, how can you add quotations to the build commands in Visual Studio 2008? – Corey Jun 27 '12 at 14:12
  • Simply place quotation marks around the required part of the custom build command. – Dmitry Egorenkov Jul 02 '12 at 10:06
  • It wasn't a custom build command, default with visual studio build. – Corey Jul 03 '12 at 14:04