We have a type called Action in our library. We support VS2005, 2008 and now trying to support VS2010 too. When I include the namespace containing our 'Action' type and also 'System' together in a file and try to use it, it cribs saying ambiguous reference call between our Action type and System.Action delegate. This is happening only in VS2010 and it does not throw error in VS2008 or VS2005 even though nothing has changed with the Action delegate (namespace, assembly everything is the same between 3.5 and 4.0). Any idea why this could be happening?
UPDATE:
I created a simple application to reproduce this:
Class1.cs:
using System; using System.Collections.Generic; using System.Text;
namespace Namespace1 { public enum Action { Mouse, Keyboard } }
Class2.cs:
using Namespace1; using System; using System.Collections.Generic; using System.Text;
namespace Namespace2 { public class Class2 { public Class2() { Action a; } } }
The above code compiles fine in VS2008 but throws error in VS2010: "error CS0104: 'Action' is an ambiguous reference between 'Namespace1.Action' and 'System.Action'"
I get the same error when I use VS2010 and target Framework 3.5 instead of 4.0.
Thanks, Niranjan