I'm making a small package in SSIS (Integration Services), and in my control flow I have a couple of script tasks and some data flows reading data from XML files into the database.
I made some edits to the C# code in a script task in the built-in Visual Studio editor, and hit save. The star by the file name disappeared, indicating the file was saved. I closed the Visual Studio editor, saved the package, right-clicked the script task and chose "Execute task". It ran without errors, but the XML files it was supposed to create never appeared, so I opened the script in the Visual Studio editor again, and to my horror only the default script was there (e.g. only the main method and it only contained the Dts.TaskResult = (int)ScriptResults.Success; statement)!
I have been unable to find the code I had in that script task, and when I open the .dtsx file in a text editor my code is gone! The code in the other script task is there though.
I was paying careful attention, so there's no way I mistakenly deleted everything before closing the editor and saving the package.
So my question is: Has anyone else encountered this totally insane bug, and is there a way to recover the code; or do I just have to bite the bullet and recreate it from memory?
We rarely use any significant amount of C# code in these SSIS jobs, so we don't have any integrated VCS. I have been copying the code to a new file and manually adding it to my own Git repo, just to be safe, but I hadn't done that yet with this particular code.
And I just have to restate my frustration with such an amazingly bad bug in Visual Studio...
cancelinstead ofOKwhen exiting, the script task, but the change I had done was small. The other code in that script task had been written over a couple of days and saved many times. That last time it deleted ALL of it and replaced it with the standard template.