473,320 Members | 1,845 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 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 3222
[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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Joe DeAngelo | last post by:
When I try to compile a source code which should normally run I got this error message error CS0246: The type or namespace name 'XmlSchemaSet' could not be found (are you missing a using...
0
by: manfred | last post by:
Hello, I have this error with C# code Compiler Error CS0246: The Type or Namespace Name <XmlNavigator> Could Not be Found or Compiler Error CS0246: The Type or Namespace Name...
0
by: Leo | last post by:
Hi, The code below is working: Main.cs ------------- using System; namespace test3
1
by: Kumar Bhogaraju | last post by:
We developed an application in 2.0; but our new hosting provider supports only 1.1. Can anyone point me to a link where we can migrate the application easily without rewriting the code? When we...
0
by: WebDev2 | last post by:
I can't get AJAX.NET Pro to work. I keep getting a Compiler Error Message: CS0246: The type or namespace name 'AjaxPro' could not be found (are you missing a using directive or an assembly...
4
by: infinetinc | last post by:
I'm receiving the following error when this site is published to the production environment: Compiler Error Message: CS0246: The type or namespace name 'GridViewHelper' could not be found (are you...
5
by: Michael Bray | last post by:
I have some class files in App_Code (eg MyClass.cs) but if there is an error during compilation, the error list doesn't say what file the error is in. It just shows something like "(0,0): error...
3
by: Mariano | last post by:
Greetings, I'm developing a web site in asp.net 2.0. I have class files in App_Code and they are used in aspx. Example: * App_Code ( i have users.cs containing users class, data.cs is DAL) *...
1
by: rhea06car | last post by:
i got an error massage cs0246: The type or namespace name 'StringCollection' could not be found (are you missing a using directive or an assembly reference?) heres my code: public static...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.