title: Reference a .net 3.5 assembly in a Script Task in SSIS 2005?
body: <p>I've got this to work using a very basic example(outlined below) and I want to see if other SOers have experience doing what I'm attempting...using a 3.5 framework assembly in a Script Task in SSIS 2005.</p>
  
  <p>I've basically followed the page found <a href="http://www.texastoo.com/post/Create-a-custom-assembly-in-SSIS.aspx" rel="nofollow noreferrer">here</a>... except I targeted the 3.5 framework while in Visual Studio 2008.</p>
  
  <ol>
  <li><p>Write/compile your code (targeted the 3.5 framework) Just some simple Linq so that I'm using a greater than 2.0 framework feature</p>
  
  <pre><code>using System;  
  using System.Collections.Generic;  
  using System.Text;  
  using System.Linq;    
  
  namespace Ext
  {
     public class Extend
     {
         public string GetValue () 
         {
            /* 
               Test Linq to "prove" that we're not running against the   
               2.0 framework.
               I know this code could be improved, but bear with me...  
               it's throwaway code just to test the concept
              */
            string [] teststring = new string [3];
            teststring[0] = "named Extend";
            string returnString = String.Empty;
            var s = teststring.Where(x =&gt; x.ToString() == "named Extend");
            foreach (var x in s)
            {
              returnString = x.ToString();
            }
            return "Extending Script Task through a custom library " + returnString;
        }
     }  
  }
  </code></pre></li>
  <li>Gave it a Strong Name key</li>
  <li>Added the assembly to the GAC using gacutil</li>
  <li>Copied the assembly to the C:\Windows\Microsoft.NET\Framework\v2.0.50727 folder...dev<br>
  machine is running Windows 7</li>
  <li>Created a Script Task and added a reference to the assembly  </li>
  <li><p>In the Script Task  </p>
  
  <pre><code>Dim x As New Extend()
  MsgBox(x.GetValue.ToString())  
  </code></pre></li>
  </ol>
  
  <p>It works OK cuz when I run the SSIS project I get back a message box with the text<br>
   "Extending Script Task through a custom library named Extend"</p>
  
  <p>So...my question is will the SSIS project/Script Task still work when I try to do more sophisticated stuff...especially when I call my (yet to be written) assembly that uses LinqToEntities?</p>
  
  <p>It seems strange to me that I have to copy the file to the Framework 2.0 folder AND add it to the GAC...but maybe it's just a weird SSIS requirement...I know I can't add the reference in the Script Task unless that assembly's in the Framework 2.0 folder...</p>