Wednesday 23 May 2012

Changing .Net Framework version in SSIS

Case
SSIS 2008 uses .NET 2.0 as the standard framework version for Script Tasks and Script Components, but in some cases (Service Reference, Linq, etc) you need a higher .NET framework version. How do you change the framework?

Solution
SSIS 2008 supports 3.5 and lower (, but the standard is 2.0). SSIS 2012 supports 4.0 and lower (which is also the standard). Here is how you change it in VB.net and C#.

1) Edit Script
Edit the Script Task or Script Component so that vsta editor is open.

2) Project properties
Right click the project in the Project Explorer (SSIS 2008) / Solution Explorer (SSIS 2012) and select [Properties].
SSIS 2008

SSIS 2012







































3a) Change framework version VB.Net
Go to the Compile tab in the properties page and hit the [Advanced Compile Options...] button. This will open a popup where you can change the framework version in the Target framework dropdownbox. After that hit the OK button and confirm the changes.
5 steps in VB.Net





















3b) Change framework version C#
Go to the Application tab in the properties page and there you can change the framework version in the Target framework dropdownbox. After that you have to confirm the changes.
3 steps in C#






















4) The result
The framework has been changed and all script windows are closed. Open scriptMain.cs / scriptMain.vb (script task) or main.cs / main.cb (script component) to continue scripting.

5 comments:

  1. I did what you suggested, and was able to add the WindowsBase reference (.net 3.0) but when I tried to add my namespace import, I got a green squiggly line. When I hovered over it, I see "Namespace or type specified in the Imports 'System.IO.Packaging' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the import element name doesn't use any aliases"

    My problem is that I'm following MSDN on how to zip files, and it uses system.io.packaging, so I'm just wondering what I'm doing wrong?

    ReplyDelete
  2. This doesn't seem to work. I get the following error as a result:


    The binary code for the script is not found. Please open the script in the designer by clicking Edit Script button and make sure it builds successfully.

    ReplyDelete
    Replies
    1. Hi Beemer,

      You have to give a little more details... which SSIS version are you using? Does it concern a Script Task or Component? Does the .Net code build?

      Regards,

      Joost

      Delete

Please use the SSIS MSDN forum for general SSIS questions that are not about this post. I'm a regular reader of that forum and will gladly answer those questions over there.

All comments are moderated manually to prevent spam.

Related Posts Plugin for WordPress, Blogger...