2

I used this brilliant solution to convert a linq query to a datatable. But I'm getting a strange error when running it. Build succeeds though.

Compiler Error Message: CS0121: The call is ambiguous between the following methods or properties:
'Gruppkoll.App_Code.ConvertToDataTableFromLinqResult.ToADOTable<Gruppkoll.MessageSet
    (System.Collections.Generic.IEnumerable<Gruppkoll.MessageSet>)' and
'Gruppkoll.App_Code.ConvertToDataTableFromLinqResult.ToADOTable<Gruppkoll.MessageSet
    (System.Collections.Generic.IEnumerable<Gruppkoll.MessageSet>)'

I've tried re-building it and restarting the IIS. It seems as there are two classes with the same method but I've checked this and that's not the case.

Any ideas? I'm using .NET 4.0 ASP.NET Webforms

Community
  • 1
  • 1
Phil
  • 3,934
  • 12
  • 38
  • 62
  • Do you have multiple copies of some framework dll (one of your own) in the \bin\ directory? – Lasse V. Karlsen Oct 25 '10 at 09:33
  • I never checked but that's probably the case since App_Code is a bit special.. check my "answer" for link to explanation of problem. – Phil Oct 25 '10 at 09:38

1 Answers1

4

I solved it by moving the class outside of the App_Code directory. Explanation of why can be found here: The call is ambiguous between the following methods or properties (bug??)

Community
  • 1
  • 1
Phil
  • 3,934
  • 12
  • 38
  • 62