title: Unrecognized type or namespace in SSIS C# script
body: <p>I was trying to use regex to get a variable from a filename using a script task in SSIS.  I found the following bit of code, but several of the functions appear to be unrecognized:</p>
  
  <pre><code>List&lt;string&gt; filePatterns = null;
  public void Main()
  {
      filePatterns = new List&lt;string&gt;();
      filePatterns.Add("Folder1");
      filePatterns.Add("Folder2");
  
      string fileName = Path.GetFileNameWithoutExtension(
          Dts.Variables["User::LoopFiles"].Value.ToString());
  
      Match match = Regex.Match(fileName, string.Join("|", 
          filePatterns.ToArray()));
  
      Dts.Variables["User::FolderName"].Value = match.Value;
      Dts.TaskResult = (int)ScriptResults.Success;
  }
  </code></pre>
  
  <p>The List and Match both return </p>
  
  <blockquote>
    <p>The type or namespace name 'List' could not be found (are you missing a using directive or an assembly reference?)</p>
  </blockquote>
  
  <p>Also, Path returns the name 'Path' does not exist in the current context.</p>
  
  <p>I figure I'm missing a library of some sort, but I would like to know where to find it and how to get it referenced.</p>