Tech
Forums
Jobs
Books
Events
Live
Interviews Prep
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
I m new to c# and facing problem in own custom namespace .
D Dasawari
May 8 2015 6:48 AM
402
Reply
Hi,
I am new to C# and I made own custom namespace lets say "namespace1" and referred in another namespace lets say "namespace2". When i run them , error comes like:
"Error 1 Program 'c:\c#_projects\namespace1\namespace1\obj\Debug\namespace1.exe' does not contain a static 'Main' method suitable for an entry point C:\c#_projects\namespace1\namespace1\CSC namespace1" .
Please rectify it.
Source Codes are given below:
1. namespace1 :
using System;
namespace namepspace1
{
class n1
{
public void Hello()
{
Console.WriteLine("Hello, C# World!");
}
}
}
2. namespace2 :
using System;
using namespace1;
namespace namespace2
{
class n2
{
static void Main()
{
n1 cls = new n1();
cls.Hello();
}
}
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
how to play local drive mp3 song in c# asp.net
how to stop change of objects in collection using c#.