471,612 Members | 1,389 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,612 software developers and data experts.

Error CS0246

Leo
Hi,

The code below is working:

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 the namespace vijay in another 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");
}
}
}

I'am getting the following 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 the assembly reference.If it is so how do i change that.
Thanks in advance.

Leo

Nov 25 '05 #1
1 3112
[There's no need to post the same question four times, by the way...]

Leo <be*********@yahoo.com> wrote:
The code below is working:
<snip>
I want to put the namespace vijay in another document. The code will be:
<snip>

Well, no it won't, quite. You haven't posted code that even *should*
work:

1) Main needs to be capitalised for it to be the default entry point
2) You've got one of your braces the wrong way round
3) You've called Console.Writeline instead of Console.WriteLine

It's *very* important to cut and paste *actual code* rather than just
typing something which approximates to it. It doesn't need to be code

<snip>
I'am getting the following 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 the assembly reference.If it is so how do i change that.


It would only be a missing assembly reference if the two files were in
different projects. Are they?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Nov 25 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by manfred | last post: by
reply views Thread by Leo | last post: by
1 post views Thread by Kumar Bhogaraju | last post: by
3 posts views Thread by Mariano | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by CCCYYYY | last post: by
1 post views Thread by ZEDKYRIE | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.