开发者

Error on "ambigous reference" points to same method twice

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


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??)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜