473,545 Members | 2,469 Online
Bytes | Software Development & Data Engineering Community
+ 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 1392
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 error: Type 'System.String' is not defined.
2
1154
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 Behind: * Dim NewClass1 As New Namespace.Namespace2.Class1
3
1315
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 reference class in this namespace from a method in a class in the same namespace, the compiler makes me fully qualify the return type. It may have...
4
3239
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
5859
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 namespace'::f(void)" What have I done wrong? Thanks.
5
14013
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 VIS.DLL via Visual Studio, with no problems: ------ Rebuild All started: Project: VIS, Configuration: Debug .NET ------ Preparing resources......
6
3402
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 say I enter code at the end of this question in to the code section. How then would I reference this in a new Web Application (or in the same web...
14
6674
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" process I am introducing namespaces to properly compartmentalise sections of the code into logical units. What I am speciffically trying to get right is...
32
30462
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 namespace in C. Of course, namespace doesn't eliminate name polution, but it helps more than just to put some prefix before a function name. Is it because...
3
1313
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 project would not recoginize any assembly which had been added to the project, even know they were all there, this happened to the designer.cs file that...
0
7490
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7425
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7682
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
6009
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5351
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5069
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3479
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1911
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
734
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.