473,397 Members | 2,099 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,397 software developers and data experts.

Namespace syntax question

I haven't made all that much use of 'Namespace' but I thought I understood
it. I'm in the process of translating a C# project to VB. (Dot Net 2.0)

In the program I'm working on now, I have a root namespace of <Name1>.<Name2>

In a project sub-folder I have a class file (call it Class2) with the
namespace of <Name1>.<Name2>.<Name3>

In the main directory, in the main class file (call it Class1), it is
necessary to reference items in Class2. The original C# version of Class1
had a declaration of 'using <Name1>.<Name2>.<Name3>; The VB equivalent
(Imports <Name1>.<Name2>.<Name3>) does not seem to work.

However 'Imports <Name1>.<Name2>.<Name1>.<Name2>.<Name3does work.

What's am I forgetting?
Aug 15 '08 #1
1 926
Clear out the 'root namespace' in the new VB project. VB regards everything
in the project as being in this namespace, while in C# the meaning of 'root
namespace' means little more than the default namespace to insert in new
classes.
--
http://www.tangiblesoftwaresolutions.com
C++ to C#
C++ to VB
C++ to Java
VB & C# to Java
Java to VB & C#
Instant C#: VB to C#
Instant VB: C# to VB
Instant C++: VB, C#, or Java to C++/CLI
"B. Chernick" wrote:
I haven't made all that much use of 'Namespace' but I thought I understood
it. I'm in the process of translating a C# project to VB. (Dot Net 2.0)

In the program I'm working on now, I have a root namespace of <Name1>.<Name2>

In a project sub-folder I have a class file (call it Class2) with the
namespace of <Name1>.<Name2>.<Name3>

In the main directory, in the main class file (call it Class1), it is
necessary to reference items in Class2. The original C# version of Class1
had a declaration of 'using <Name1>.<Name2>.<Name3>; The VB equivalent
(Imports <Name1>.<Name2>.<Name3>) does not seem to work.

However 'Imports <Name1>.<Name2>.<Name1>.<Name2>.<Name3does work.

What's am I forgetting?
Aug 16 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Elaine Jackson | last post by:
I would like to be able to write a function f, which will live in a module M, and will call a function g, such that, when f is imported from M into the interpreter, and invoked there, its...
6
by: clinton__bill | last post by:
Hi, I usually use "using namespace <namespace_name>" to reference a namespace. Today I run across a code, in its header file it has this, namespace SP1{ class C1; } While SP1::C1 is a...
6
by: ryan.d.rembaum | last post by:
Hello, I have code that I wish to use in many web applications. Basically sort of stand utility stuff. So from Visual Studio Project I select add a component and chose Component Class. Lets...
32
by: toolmaster | last post by:
Since many of the modern computer languages have built-in namespace features, I can't understand why not add this feature into standard C. I've heard many people complain of the lacking of...
3
by: Schizoid Man | last post by:
Hi, I'm a novice whose just about migrating to C++ after cutting my teeth on C for a few years. To start with I'm using Microsoft's out-of-the-box Visual C++ Express Edition compiler and I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.