Compiler Error CS1503
Argument 'argument' cannot convert from TypeA to TypeB
The type of one argument in a method does not match the type that was passed when the class was instantiated.
The following sample generates CS1503:
C#
namespace x
{
public class a
{
public a(char i)
// try the following constructor instead
// public a(int i)
{
}
public static void Main()
{
a aa = new a(2222); // CS1503
}
}
}
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
.NET feedback
.NET is an open source project. Select a link to provide feedback: