473,480 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Namespace Compile Issue

I am having a problem with namespace resolution. Example is below:

Namespace MyNamespace
Public Class MyClass
public x as System.String
end class
end namespace

I get the following compile error:
Type 'System.String' is not defined.

Using VS 2003. There is a reference to system.dll in the project. Nothing
else unusual that I know of. Why won't it resolve System.String?
If I make it just String it works, but I am using some generated code so
this is not easy to change everywhere.

Please help!!!
Thanks, Brian.
Nov 22 '05 #1
2 1383
The main issue I see, from the code sample, is MyClass, which is an illegal
class name. Are you command line compiling?

---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

"Brian" wrote:
I am having a problem with namespace resolution. Example is below:

Namespace MyNamespace
Public Class MyClass
public x as System.String
end class
end namespace

I get the following compile error:
Type 'System.String' is not defined.

Using VS 2003. There is a reference to system.dll in the project. Nothing
else unusual that I know of. Why won't it resolve System.String?
If I make it just String it works, but I am using some generated code so
this is not easy to change everywhere.

Please help!!!
Thanks, Brian.

Nov 22 '05 #2
Thanks for the reply......I got the mystery solved.
One of the generated classes in the namespace was named System. Obviously
this caused havoc resolving any type that was System.*

It hit me on the way home tonight!

Brian

"Cowboy (Gregory A. Beamer) - MVP" wrote:
The main issue I see, from the code sample, is MyClass, which is an illegal
class name. Are you command line compiling?

---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

"Brian" wrote:
I am having a problem with namespace resolution. Example is below:

Namespace MyNamespace
Public Class MyClass
public x as System.String
end class
end namespace

I get the following compile error:
Type 'System.String' is not defined.

Using VS 2003. There is a reference to system.dll in the project. Nothing
else unusual that I know of. Why won't it resolve System.String?
If I make it just String it works, but I am using some generated code so
this is not easy to change everywhere.

Please help!!!
Thanks, Brian.

Nov 22 '05 #3

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

Similar topics

2
261
by: Brian | last post by:
I am having a problem with namespace resolution. Example is below: Namespace MyNamespace Public Class MyClass public x as System.String end class end namespace I get the following compile...
2
1142
by: Jon Gonzales | last post by:
Item #1: Project Reference > DLLClass1 Project Properties > Imports > Namespace.Namespace2 - In Code Behind: * Dim NewClass1 As New Class1 Item #2: Project Reference > DLLClass1 - In Code...
3
1307
by: John Ratliff | last post by:
I have a program, the classes that belong to it all belong to a special namespace I created for them. This had lead to a minor issue I don't quite understand. For some reason, when I return a...
4
3233
by: Eric Lilja | last post by:
Hello, consider this program: #include <iostream> #include <algorithm> #include <string> #include <cctype> int main() { std::string s = "HEJ";
8
5855
by: Jason Heyes | last post by:
I wrote: namespace { void f(); } void f() { std::cout << "hello world" << std::endl; } When I compile, I receive this error: unresolved external symbol "bool __cdecl `anonymous...
5
13996
by: Genboy | last post by:
My "VIS" Website, which is a C# site created in VS.NET, Framework 1.1, is no longer compiling for me via the command line. As I have done 600 times in the last year and a half, I can compile to...
6
3394
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...
14
6667
by: Jon Rea | last post by:
I am currently cleaning up an application which was origainlly hashed together with speed of coding in mind and therefore contains quite a few "hacky" shortcuts. As part of this "revamping"...
32
30452
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
1307
by: =?Utf-8?B?QWxleGFuZGVyIFd5a2Vs?= | last post by:
I recently raninto major problems when I added the Exception namespace to the Project which has my DBML file attached to it. Once I renamed all the Exceptions instances to Syste.Exception the...
0
7040
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
6905
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...
1
6736
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6908
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...
1
4772
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4478
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2994
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2980
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
561
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.