2017-06-22 96 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的更多信息。