Official CozyRoc Blog

July 2, 2007

SSIS project (dtsx) serialization hack

Filed under: SSIS, Tips — COZYROC @ 3:13 pm

If you are interested in SSIS project deserialization, here is a brief summary of the steps you need to follow to install your own deserialization routines (please have Reflector in hand because most of the details below are undocumented):

1. Make sure you have reference to the following libraries:

  • Microsoft.DataTransformationServices.Design.DLL
  • Microsoft.DataWarehouse.VsIntegration.dll
  • Microsoft.DataWarehouse.DLL

3. Install handler for application.Events.SelectionEvents::OnChange event.
4. Check selected item is of type ProjectExt.
5. Install your own ISettingsService service provider class. You can get access to the service container and current ISettingsService service provider with the following code:

Hierarchy projHierarchy = project.GetType().InvokeMember(
   "ProjectHierarchy",
   BindingFlags.GetProperty | BindingFlags.NonPublic | BindingFlags.Instance,
   null,
   project,
   new object[] { } ) as Hierarchy;
IServiceContainer serviceContainer = (IServiceContainer)projHierarchy.GetService(
   typeof( IServiceContainer ) );
ISettingsService ssOld = (ISettingsService)serviceContainer.GetService(
   typeof( ISettingsService ) );

6. Override ISettingsService::GetSetting method and check:

  • settingContext is “Serialization\SerializableComponents”
  • scope is SettingsScope.Machine
  • settingName is “dtsx”

If you have a match, you have to return a type to a dummy class whose only purpose is to provide attributes, used by the infrastructure internally. The default implementation is called PseudoPackage. Attribute your new dummy class with DesignerSerializer attribute and parametrize it with your own serialization class. It has to inherit from DtrDesignerSerializer class.

7. Override DeserializeComponent and SerializeComponent. These are the methods, which will be called for each SSIS project task during serialization. Voila! Now you are the master of the universe.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: