|
Matt - thanks for the response. You nailed it, and based on the info you gave, I have been able to solve this programmatically. Option 2 that you put out there doesn't work, but was worth a shot.
I created a blog post with the problem/solution, so hopefully the next person will find this posting and that blog post. Not sure if I am allowed to post links, but here it is: http://key2consulting.com/Blogs/jrobinson/2012/02/01/editing-existing-ssis-package-via-ezapi-or-standard-ssis-api-doesnt-update-layout-in-bids/
Also, once I was on the right track, I found a post from the SQL Server Forum Support Team that describes the exact problem and provides the XML search/replace code to solve it. Here is a link to that posting for anyone else that needs it in the future: http://blogs.msdn.com/b/sqlforum/archive/2011/02/28/faq-how-do-i-refresh-the-layout-information-of-a-sql-server-integration-services-ssis-package-that-is-modified-programmatically.aspx
Here is the code that I came up with to fix it, you could just use this code in any "SavePackage" methods that you write:
//Save the package object to XML
string strXML = null;
strXML = TestPackage.SaveToXML();
//Count instances of existing SSIS layout code in package.
int LayoutCount = Regex.Matches(strXML, "<DTS:PackageVariable>").Count;
//Remove the layout information.
for (int i = 0; i < LayoutCount; i++)
{
strXML = strXML.Remove(strXML.IndexOf("<DTS:PackageVariable>"), strXML.IndexOf("</DTS:PackageVariable>") - strXML.IndexOf("<DTS:PackageVariable>") + 22);
}
Thanks again for the help!
-Josh
|