2017-06-22 45 views
1

我想在構建自定義項目後獲得託管解決方案。但在默認.TARGET文件沒有指定「/ packagetype」在託管解決方案的一部分SolutionPackager的說法:定製項目構建

<!-- Unmanaged solution --> 
    <Exec Condition="'$(SolutionType)' == '0' or '$(SolutionType)' == '2'" 
     Command="REM SET AssemblyVersionDefinitionFile=$(AssemblyVersionDefinitionFile) 
      REM SET AssemblyVersionName=$(AssemblyVersionName) 
      &quot;$(SolutionPackagerDir)\SolutionPackager.exe&quot; -a:pack -z:&quot;$(OutDir)$(TargetName).zip&quot; -f:&quot;$(IntermediateOutputPath)\$(BeforeLocDir)&quot;" /> 

    <!-- Managed solution --> 
    <Exec Condition="'$(SolutionType)' == '0' or '$(SolutionType)' == '2'" 
    Command="REM SET AssemblyVersionDefinitionFile=$(AssemblyVersionDefinitionFile) 
      REM SET AssemblyVersionName=$(AssemblyVersionName) 
      &quot;$(SolutionPackagerDir)\SolutionPackager.exe&quot; -a:pack -z:&quot;$(OutDir)$(TargetName)_managed.zip&quot; -f:&quot;$(IntermediateOutputPath)\$(BeforeLocDir)&quot; -p:Managed" /> 

我所有的努力,以指定「/ packagetype」參數(如「/ P:託管」或'-p:託管')不成功。我做錯了什麼?

UPD

輸出爲:

1> Solution package type did not match requested type. 
1> Command line argument: Unmanaged 
1> Package type: Managed 

我在哪裏可以更改命令行參數?

回答

0

生成項目後無法獲得託管解決方案,因爲您在自定義項目中導出了非託管解決方案。關於XML的差異,請閱讀here

至於「/ packagetype」 - 這個參數是可選的。您可以省略此參數,因爲可以從.zip文件或組件文件中讀取軟件包類型。有關解決方案包裝商here的更多信息。