Compiler Error CS0128
A local variable named 'variable' is already defined in this scope
The compiler detected declarations of two local variables with the same name. For more information, see Methods.
The following sample generates CS0128:
// CS0128.cs
namespace MyNamespace
{
public class MyClass
{
public static void Main()
{
char i;
int i; // CS0128
}
}
}
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: