Debug and improvements

Feb 4, 2009 at 6:45 AM
Hi,

Thanks for your Sharepoint adapters. But... I would like to test, debug and improve it. How can I run it in debug mode ? How did you develop that component ? Can you provide us a guideline ? So that I can improve your components (see culture issue).

Thanks
Coordinator
Feb 11, 2009 at 1:35 PM
The main way I debug it is as follows:
Open up a VS with the SharepointUtility project.  I do have a test project for this (with ^80% code coverage when it was originally made) but due to SharePoint needing a specific list to be setup, it is not included in the code here. Get the project to build successfully. (Just build, and ensure the post-build action works whicih registers the component)

Open another VS with just the SharepontSSISAdapter project.  Make sure the reference to SharepointUtility is valid and get this to build next primarily watching the post-build to make sure it registers the component in the gac as well.

Now you can make a postbuild, or make two windows, one with the debug folder for the ssis adapter, and one with the \program files\microsoft sql server\100\dts\pipelinecomponents folder and drag the ssis adapter dll into that folder when you're done building.

Now open up a third VS and create your 'test' package.  To enable testing, add a debug on the package at some point before your dataflow.  Run the package and when it hits the breakpoint, go into the corresponding projects you want to debug with.  I might set some breakpoints in the SSISAdapter Project, and i'll use Attach to Process, find the DTEXEC process which has managed code, and then when I continue from the SSIS Package in the IDE, it will break out into my other project.

You CAN also attach your SSISAdapter to the devenv.exe process which you opened for the SSIS Test Package, and this is useful to test Validations which you see are failing.  As soon as you do that, you can break out for those.

However, if you rebuild the SSIS Adapter or SharePoint utility projects, then to see the changes in the VS IDE With Test SSIS Package, you'll need to close and reopen VS to that projects.  If you are changing something like writing or reading the data during a transfer, or something that happens when it is executing (not something IDE related like validation or initializing the outputs), then you can just rebuild and re-run, I think it will spawn a new dtexec and it will have the DLLS that you just built in there.

NOTE: Make sure you open both of those VS projects up in windows admin mode if using vista/server2008/7 or else the post-build actions will always fail.

Hopefully this helps and is not too confusing :) After I get it all setup, then I use that solution and projects as my 'master', and any changed files, I just get from tfs into a different folder and do a manual merge.  So I have a solution folder where I test from, and I have a solution folder with the bits I get from this site.  Easier for me to keep them separate.
Feb 17, 2009 at 3:18 PM
thanks, i'll try it as soon as possible.