CS0246

G

Guest

The code bellow is working when i put it all in 1 document:

Main.cs
-------------

using System;

namespace test3
{
class zzz
{
public static void main()
{
vijay.yyy.abc();
}
{
}

namespace vijay
{
class yyy
{
public static void abc()
{
System.Console.Writeline("abc");
}
}
}

I want to put namespace vijay in antother document. The code will be:

Main.cs
-------------

using System;
using vijay;

namespace test3
{
class zzz
{
public static void main()
{
vijay.yyy.abc();
}
{
}

yyy.cs (the other document)
-----------
using System;

namespace vijay
{
class yyy
{
public static void abc()
{
System.Console.Writeline("abc");
}
}
}

Getting the error:

The type or namespace "vijay" could not be found (are you missing a using
directive
or an assembly reference (CS0246)).
I think it is an assembly reference is, how do i change this?

Thanks in advance

Leo van den Berg
 
S

S.M. Altaf [MVP]

I noticed two Main.cs files. Have you set a reference to the assembly
containing the vijay namespace?
 

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

Top