error in my prog with VS 2005 C#

  • Thread starter Thread starter Andrey Koptyaev
  • Start date Start date
A

Andrey Koptyaev

I try to buid little prog from Shildt book but error.VS 2005
Here:
using System;
class Example
{
public static void Main()
{
Console.WriteLine("Simple C# program");
}
}
In VS 2005 error: The namespace '<global namespace>' already contains a

definition for 'Example'

What I must improve?
 
You need to put your class into a namespace

using System;
namespace Test
{
class Example
{
....
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Bug in Regex? 5
Derived classes and overloaded methods 4
C# 2.0.50727 compiler crashes 2
Using C++ DLL in C# 5
static 2
Use of event handling 6
Interface re-implementation changed from 1.0 to 2.0??? 20
error :( 4

Back
Top