Open Sesame! - Dynamics CRM 2011 Solution File

I like breaking into things to see what they look like on the inside, on a rainy day like today with not much to do I decided to see what the solution export file is made of.

The exported zip file is similar to the Microsoft Office files, inside the zip file there is [Content_Types].xml which is exactly what's in a Office document if you open it up in a tool like WinRAR, even the xml schema is the same, great to see consistency!.

Next, we have the solution.xml file, it defines the publisher and it's details along with other settings like:

  • Is the solution managed
  • Schema prefix
  • Components (webresources, plugins, plugin steps...etc)
<ImportExportXml version="5.0.9585.8" minimumversion="5.0.0.0" languagecode="1033" generatedBy="OnPremise" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <SolutionManifest>
    <UniqueName>AutoNumbering</UniqueName>

    <Descriptions>
      <Description description="Automatic numbering for built-in and custom entities in Dynamics CRM 2011." languagecode="1033" />
    </Descriptions>
    <Version>1.0</Version>
    <Managed>1</Managed>
    <Publisher>
      <UniqueName>magnetism</UniqueName>

      <CustomizationPrefix>mag</CustomizationPrefix>
      <CustomizationOptionValuePrefix>80973</CustomizationOptionValuePrefix>
      <Addresses>

The components:

  • 1 = entity
  • 61 = web resource files
  • 91 = plugin assembly
  • 92 = plugin step which is defined in detail inside the customizations.xml file
    <RootComponents>
      <RootComponent type="1" schemaName="mag_autonumber" />
      <RootComponent type="61" schemaName="mag_autonumber_16x16" />
      <RootComponent type="61" schemaName="mag_autonumber_32x32" />
      <RootComponent type="61" schemaName="mag_autonumber_66x48" />
      <RootComponent type="91" schemaName="Magnetism.AutoNumbering, Version=1.0.0.0, Culture=neutral, PublicKeyToken=fe444c1613c40597" />
      <RootComponent type="92" id="{c3acd8ac-8cbf-df11-8af4-00155d031a1b}" />
    </RootComponents>

Onto the customizations.xml file, this is very similar to CRM 4 customizations.xml file, the major difference is since you're only exporting your solution it'll only include the items belonging to that solution where CRM 4 would export everything.

Each web resource that was defined in the solution.xml is broken down into more detail in the customizations.xml file. WebResourceType element defines the file type, 7 is a gif, 10 is a ico file. On a side note might be interesting to see what happens when the boolean switches are turned on/off (another post maybe)

  <WebResources>
    <WebResource>
      <WebResourceId>{ec7cd845-cabf-df11-8af4-00155d031a1b}</WebResourceId>
      <Name>mag_autonumber_16x16</Name>
      <DisplayName>Auto Number icon 16x16</DisplayName>
      <LanguageCode>1033</LanguageCode>
      <WebResourceType>7</WebResourceType>
      <IsCustomizable>1</IsCustomizable>
      <CanBeDeleted>1</CanBeDeleted>
      <IsHidden>0</IsHidden>
      <FileName>/WebResources/mag_autonumber_16x16EC7CD845-CABF-DF11-8AF4-00155D031A1B</FileName>
    </WebResource>
  <SolutionPluginAssemblies>
    <PluginAssembly FullName="Magnetism.AutoNumbering, Version=1.0.0.0, Culture=neutral, PublicKeyToken=fe444c1613c40597" CustomizationLevel="1">
      <IsolationMode>2</IsolationMode>
      <SourceType>0</SourceType>
      <FileName>/PluginAssemblies/MagnetismAutoNumbering-E9AF0374-DB8D-42A3-9F2B-F6EEBE811087/MagnetismAutoNumbering.dll</FileName>
      <PluginTypes>
        <PluginType AssemblyQualifiedName="Magnetism.AutoNumbering.NumberMe, Magnetism.AutoNumbering, Version=1.0.0.0, Culture=neutral, PublicKeyToken=fe444c1613c40597" Name="Magnetism.AutoNumbering.NumberMe">
          <FriendlyName>e49ab029-c2bd-4685-a6b4-c9c77dcd56b5</FriendlyName>
        </PluginType>
      </PluginTypes>
    </PluginAssembly>
  </SolutionPluginAssemblies> 

IsolationMode is either sandboxed or not, SourceType is where the assembly is stored, in the database, GAC or disk. If you select the database option it stores the assembly inside the exported zip file, in my case inside \customizations.zip\pluginassemblies\solutionname-id\*.dll

I'm suprised that the export file is open, would be nice if it was encrypted to make it harder to peek inside, looks like obfuscating your plugins/workflows and building in licensing into your addons are couple of ways to cover yourself when the Dynamics CRM marketplace opens.

Enjoy!

2 Comments

Comments have been disabled for this content.