I am trying to use MSBuild to build a Visual Studio Setup Project using the article below:
http://msdn.microsoft.com/en-us/library/ms404859.aspx
https://web.archive.org/web/20090218033835/msdn.microsoft.com/en-us/library/ms404859.aspx
I have followed all the steps mentioned in the article above with the exception of not using TFS in this case.
Instead of using the TFS option, I am trying to create a Demo.proj file and have included the below details: ** - Demo.proj**
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="AfterCompile">
<Exec Command=""$(ProgramFiles)\Microsoft Visual Studio 9.0\Common7\IDE\devenv" "C:\Users\sapatro\Documents\visual studio 2010\Projects\HelloWorldTest\HelloWorldTestInstaller\HelloWorldTestInstaller.vdproj" /Build "Debug|Any CPU""/>
<Copy SourceFiles="C:\Users\sapatro\Documents\visual studio 2010\Projects\HelloWorldTest\HelloWorldTestInstaller\Debug\HelloWorldTestInstaller.msi; C:\Users\sapatro\Documents\visual studio 2010\Projects\HelloWorldTest\HelloWorldTestInstaller\Debug\setup.exe" DestinationFolder="$(OutDir)" />
</Target>
</Project>
now when I trying to cmd prompt and trying the following command:
msbuild DemoBuild.proj /target:AfterCompile
I am getting the following error:
Build FAILED.
"C:\xxxxxxxxx\Documents\Visual Studio 2010\Projects\HelloWorldTest\DemoBuild.proj" (default target) (1) -> (AfterCompile target) -> C:\xxxxxxxxx\Visual Studio 2010\Projects\HelloWorldTest\DemoBuild.proj(4,5): error MSB3073: The command ""C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv" "C:\xxxxxxxxx\Documents\visual studio 2010\Projects\HelloWorldTest\HelloWorldTestInstaller\HelloWorldTestInstaller.vdproj" /Build "Debug|Any CPU"" exited with code 1.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:01.25
Can anyone help me to resolve this issue.
Thanks & Regards, Santosh Kumar Patro
This works for me:
<Exec Command=""$(ProgramFiles)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.com" your.vdproj /build "Debug|AnyCPU""/>
You don't need the space in any cpu and you need to call devenv.com, also assuming you have those build configuration existing?
James' answer helped me but I still got an error stating An error occurred while validating
.
I had to also do this and finally got it working. For VS2015, add the registry key HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0_Config\MSBuild\EnableOutOfProcBuild
and set the value to 0.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With