Search code examples
dynamics-crmcrmmicrosoft-dynamics

Customization project build


I'm trying to get managed solution after build customization project. But in the default .target file don't specified "/packagetype" argument of SolutionPackager in a Managed Solution part:

    <!-- 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" />

All my attempts to specify "/packagetype" argument (like '/p:Managed' or '-p:Managed') were unsuccessful. What I'm do wrong?

UPD

The Output is:

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

Where I can change command line argument?


Solution

  • You can't get managed solution after build project because you exporting unmanaged solution in your customization project. About differences in XML's read here.

    As for "/packagetype" - this argument is optional. You can omitted this argument, because the package type can be read from inside the .zip file or component files. More information about solution packager here.