Two CS files (using namespaces) 
Author Message
 Two CS files (using namespaces)

Mike,

    In the file without the namespace I believe you want to put this at the
top:

// Use shorthand for the classes in the namespace in the other files.
using MyNameSpace;

    This will allow you to use the shorthand for the classes in the other
namespace.

    Hope this helps.

--
               - Nicholas Paldino [.NET/C# MVP]


Quote:
> New to C#

> Using the SDK, do not have VS.NET

> I have two cs files.

> One file contains a few classes.  The other contains a
> namespace

> In the file without the namespace I am trying to call a
> class in the namespace.

> I tried to compile both of these files
> csc /t:exe /recurse:*

> Note:  These two cs files are the only files I am trying
> to compile.  Is there another file I need to link the
> files together?

> Thanks

> Mike

> Error I get when trying to compile------
> cs1.cs(12,5): error CS0234: The type or namespace
> name 'Prin' does not exist in the class or
> namespace 'MyNameSpace' (are you missing an assembly
> reference?)



Tue, 19 Apr 2005 00:52:05 GMT  
 Two CS files (using namespaces)
New to C#

Using the SDK, do not have VS.NET

I have two cs files.

One file contains a few classes.  The other contains a
namespace

In the file without the namespace I am trying to call a
class in the namespace.

I tried to compile both of these files
csc /t:exe /recurse:*

Note:  These two cs files are the only files I am trying
to compile.  Is there another file I need to link the
files together?

Thanks

Mike

Error I get when trying to compile------
cs1.cs(12,5): error CS0234: The type or namespace
name 'Prin' does not exist in the class or
namespace 'MyNameSpace' (are you missing an assembly
reference?)



Tue, 19 Apr 2005 00:37:32 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Reuse of cs files, namespace, arch advice pls

2. Newbie: separate big .cs file into small .cs files

3. using config file and the configuration namespace

4. resx files needed for cs - files ??

5. CS files display in VS6 like CPP files ?

6. Using global variables from two .cpp files

7. Using global variables from two .cpp files

8. Using global variables from two .cpp files

9. VC5.0 does work when using namespaces with using directive

10. Compile CS source code using ICodeCompiler

11. Survey on using C as intro CS langauge (?)

12. Survey on using C as intro CS langa

 

 
Powered by phpBB® Forum Software