title: Xslt cant see assembly reference
body: <p>In my xslt i have a piece of C# code : </p>
  
  <pre><code>public string CleanForTableTags(string pContent){
  
          string input = String.Concat("&lt;root&gt;", pContent, "&lt;/root&gt;");
  
      System.Xml.Linq.XDocument doc = System.Xml.Linq.XDocument.Parse(input, System.Xml.Linq.LoadOptions.PreserveWhitespace);
  
      var valueWithinTags = doc.Root.Element("table").ToString();
      string[] values = Regex.Matches(valueWithinTags, @"&lt;.*?&gt;")
          .Cast&lt;Match&gt;()
          .Select(o =&gt; o.Groups[0].Value)
          .ToArray();
  
      System.Guid d = System.Guid.NewGuid();
      string s = pContent.Replace(valueWithinTags, d.ToString());
  
      return s;
  }
  </code></pre>
  
  <p>as u can see i use: System.Xml.Linq</p>
  
  <p>in my webconfig ive got : </p>
  
  <pre><code>    &lt;compilation debug="true"&gt;
          &lt;assemblies&gt;
              &lt;add assembly="WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
              &lt;add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/&gt;
              &lt;add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&gt;
              &lt;add assembly="System.Drawing.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/&gt;
              &lt;add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&gt;
              &lt;add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
              &lt;add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&gt;
      &lt;add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&gt;
              &lt;add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&gt;&lt;/assemblies&gt;
      &lt;/compilation&gt;
  </code></pre>
  
  <p>And still i am getting : </p>
  
  <p>The type or namespace name 'Linq' does not exist in the namespace 'System.Xml' (are you missing an assembly reference?)</p>
  
  <p>What am i doing wrong? </p>
  
  <p>I am using VS 2008. All paths to Dlls are correct, if i use same piese of code from a class it work without problems, but as soon it is used inside of xslt, im getting error</p>
  
  <p><strong>Next problem :</strong> </p>
  
  <p>now its failing on </p>
  
  <pre><code>string[] values = Regex.Matches(valueWithinTags, @"&lt;.*?&gt;")
              .Cast&lt;Match&gt;()
              .Select(o =&gt; o.Groups[0].Value)
              .ToArray();
  
  
  
  'System.Text.RegularExpressions.MatchCollection' does not contain a definition for 'Cast' and no extension method 'Cast' accepting a first argument of type 'System.Text.RegularExpressions.MatchCollection' could be found (are you missing a using directive or an assembly reference?)
  </code></pre>