2016-05-12 84 views
0


我想使用MsBuild任務在我的Wix Visual Studio項目中獲取被引用項目的Output文件夾。但它與下面的錯誤而失敗:
MSBuild:Wix項目中的ProjectReference輸出路徑

C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(724,5): error : The OutputPath property is not set for project 'ConsoleApplicatio n1.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Release' Platfo rm='x86'. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Plat form that doesn't exist for this project. [C:\Users\fwaheed\Documents\Visual Studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.cspro j]

以下是目標調用MSBuild任務。

<Target Name="AfterBuild"> 
     <MSBuild 
      Projects="@(ProjectReference)" 
      Targets="GetTargetPath" 
      BuildInParallel="false" 
      Condition="'%(Name)'=='ConsoleApplication1'" > 
     <Output TaskParameter="TargetOutputs" ItemName="DependentAssemblies" /> 
    </MSBuild> 
    </Target> 

請注意,如果它是CSharp項目,但是在Wix項目中失敗,那麼相同的目標工作得很好。

有人可以指導如何獲得Wix項目中的ReferencedProjects輸出目錄嗎?

感謝

回答

1

你可以嘗試看看維克斯如何它傳遞的參考值,以燭構建。它們位於wix2010.targets或wix200x.targets文件中。不幸的是,我沒有時間真正深入瞭解這些東西,但是這些任務設置的屬性應該仍然存在以供您的AfterBuild目標使用。

只需在其中一個目標文件中搜索「ResolveReferences」。

你也可以嘗試在您的csproj文件中設置

<OutputPath>somepathhere</OutputPath> 

因爲MSBuild的是抱怨屬性未設置。

+0

謝謝Brian。這是非常豐富的。但是,我仍然在我的解決方案中遇到x86或任何CPU類型問題......看起來像內部MSBuild任務不喜歡它。 –