2013-08-29 45 views
7

Tôi cố gắng để sử dụng MSBuild để xây dựng một dự án Visual Studio cài đặt bằng cách sử dụng bài viết dưới đây:Làm thế nào để sử dụng MSBuild để xây dựng một Visual Studio Thiết lập dự án

http://msdn.microsoft.com/en-us/library/ms404859.aspx

Tôi đã theo tất cả các bước được đề cập trong bài viết trên với ngoại lệ không sử dụng TFS trong trường hợp này.

Thay vì sử dụng các tùy chọn TFS, tôi đang cố gắng để tạo ra một tập tin Demo.proj và đã bao gồm các chi tiết dưới đây: ** - ** Demo.proj

<?xml version="1.0" encoding="utf-8"?> 
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 
    <Target Name="AfterCompile"> 
    <Exec Command="&quot;$(ProgramFiles)\Microsoft Visual Studio 9.0\Common7\IDE\devenv&quot; &quot;C:\Users\sapatro\Documents\visual studio 2010\Projects\HelloWorldTest\HelloWorldTestInstaller\HelloWorldTestInstaller.vdproj&quot; /Build &quot;Debug|Any CPU&quot;"/> 
    <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> 

bây giờ khi tôi cố gắng để cmd nhanh chóng và cố gắng lệnh sau:

msbuild DemoBuild.proj/target: AfterCompile

tôi nhận được lỗi sau:

Xây dựng FAILED.

"C: \ xxxxxxxxx \ Documents \ Visual Studio 2010 \ Projects \ HelloWorldTest \ DemoBuild.proj" (target mặc định) (1) -> (AfterCompile mục tiêu) -> C: \ xxxxxxxxx \ Visual Studio 2010 \ Dự án \ HelloWorldTest \ DemoBuild.proj (4,5): lỗi MSB3073: Lệnh "" 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 | Bất kỳ CPU"" thoát với mã 1.

0 Warning(s) 
1 Error(s) 

thời gian trôi qua 00: 00: 01.25

Có ai giúp tôi giải quyết vấn đề này không.

Cảm ơn & Kính trọng, Santosh Kumar Patro

Trả lời

7

này làm việc cho tôi:

<Exec Command="&quot;$(ProgramFiles)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.com&quot; your.vdproj /build &quot;Debug|AnyCPU&quot;"/> 

Bạn không cần không gian trong bất kỳ cpu và bạn cần phải gọi devenv.com, cũng giả sử bạn có những cấu hình xây dựng hiện có?

+0

Cảm ơn rất nhiều vì đã trả lời. Nó đã giúp tôi giải quyết vấn đề. –