Resolving ambiguous types with "using" doesn't work
I have a class called Group in one of my DLLs. When I use it, I get
'Group' is an ambiguous reference between 'System.Text.RegularExpressions.Group' and MyApp.Group
When I try to add
using Group = MyApp.Group;
at the top of the file, Linqpad thinks I'm trying to add a namespace and gives a
Syntax error, '(' expected
) expected
error. What should I do to use MyApp.Group?
'Group' is an ambiguous reference between 'System.Text.RegularExpressions.Group' and MyApp.Group
When I try to add
using Group = MyApp.Group;
at the top of the file, Linqpad thinks I'm trying to add a namespace and gives a
Syntax error, '(' expected
) expected
error. What should I do to use MyApp.Group?
Comments
Group = MyApp.Group
MyType = Namespace1.MyType
the error changes to "CS0236 A field initializer cannot reference the non-static field, method, or property 'Namespace2.MyType'".
The type is an enum in Namespace1, and a table class in Namespace2.
"CS1061 'ObjectSet' does not contain a definition for 'MyMember' and no extension method 'MyType' accepting a first argument of type 'ObjectSet' could be found (press F4 to add a using directive or assembly reference)"