473,732 Members | 2,204 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"'System' denotes a 'namespace' where a 'class' was expected"

I've got two projects, both reference system, system.data and system.xml and
both include the using System.Xml.Seri alization and using System at the top
of the file.

Both also include the XmlElementAttri bute attribute on some properties as
defined below, but on one project I get the error "'System' denotes a
'namespace' where a 'class' was expected" and the other project I don't.
There highlights the word System on
System.Xml.Sche ma.XmlSchemaFor m.Unqualified and I can't figure out why as
System.Xml.Sche ma.XmlSchemaFor m.Unqualified is an enum, not a namespace.

[System.Xml.Seri alization.XmlEl ementAttribute( Form=System.Xml .Schema.XmlSche maForm.Unqualif ied)]
Oct 31 '07 #1
5 3297
Hi Jeremy,

How do you use it? E.g. this works fine:

public class AClass
{
[System.Xml.Seri alization.XmlEl ementAttribute( Form = System.Xml.Sche ma.XmlSchemaFor m.Unqualified)]

int worksFine;
....
}

Regards, Alex
[TechBlog] http://devkids.blogspot.com

JI've got two projects, both reference system, system.data and
Jsystem.xml and both include the using System.Xml.Seri alization and
Jusing System at the top of the file.
J>
JBoth also include the XmlElementAttri bute attribute on some
Jproperties as defined below, but on one project I get the error
J"'System' denotes a 'namespace' where a 'class' was expected" and the
Jother project I don't. There highlights the word System on
JSystem.Xml.Sch ema.XmlSchemaFo rm.Unqualified and I can't figure out
Jwhy as System.Xml.Sche ma.XmlSchemaFor m.Unqualified is an enum, not a
Jnamespace.
J>
J[System.Xml.Seri alization.XmlEl ementAttribute( Form=System.Xml .Schema.
JXmlSchemaForm. Unqualified)]
J>

Oct 31 '07 #2
This is a copy past of the code that gets the error:

[System.Xml.Seri alization.XmlEl ementAttribute( Form=System.Xml .Schema.XmlSche maForm.Unqualif ied)]
public string Client_Name;

And this is a copy past of the code that compiles file:

[System.Xml.Seri alization.XmlEl ementAttribute( Form=System.Xml .Schema.XmlSche maForm.Unqualif ied)]
public string GivenName;

Strange hey? I can't find a difference between the two. This is VS 2003
btw.

"Alex Meleta" <am*****@gmail. comwrote in message
news:15******** *************** ***@msnews.micr osoft.com...
Hi Jeremy,

How do you use it? E.g. this works fine:

public class AClass
{
[System.Xml.Seri alization.XmlEl ementAttribute( Form =
System.Xml.Sche ma.XmlSchemaFor m.Unqualified)]
int worksFine;
...
}

Regards, Alex
[TechBlog] http://devkids.blogspot.com

JI've got two projects, both reference system, system.data and
Jsystem.xml and both include the using System.Xml.Seri alization and
Jusing System at the top of the file.
JJBoth also include the XmlElementAttri bute attribute on some
Jproperties as defined below, but on one project I get the error
J"'System' denotes a 'namespace' where a 'class' was expected" and the
Jother project I don't. There highlights the word System on
JSystem.Xml.Sch ema.XmlSchemaFo rm.Unqualified and I can't figure out
Jwhy as System.Xml.Sche ma.XmlSchemaFor m.Unqualified is an enum, not a
Jnamespace.
JJ>
[System.Xml.Seri alization.XmlEl ementAttribute( Form=System.Xml .Schema.
JXmlSchemaForm. Unqualified)]
J>


Oct 31 '07 #3
Figured it out, its because I had a property called System. I guess I'll
have to rename the property
[System.Xml.Seri alization.XmlEl ementAttribute( Form=System.Xml .Schema.XmlSche maForm.Unqualif ied)]

public string System;

"Alex Meleta" <am*****@gmail. comwrote in message
news:15******** *************** ***@msnews.micr osoft.com...
Hi Jeremy,

How do you use it? E.g. this works fine:

public class AClass
{
[System.Xml.Seri alization.XmlEl ementAttribute( Form =
System.Xml.Sche ma.XmlSchemaFor m.Unqualified)]
int worksFine;
...
}

Regards, Alex
[TechBlog] http://devkids.blogspot.com

JI've got two projects, both reference system, system.data and
Jsystem.xml and both include the using System.Xml.Seri alization and
Jusing System at the top of the file.
JJBoth also include the XmlElementAttri bute attribute on some
Jproperties as defined below, but on one project I get the error
J"'System' denotes a 'namespace' where a 'class' was expected" and the
Jother project I don't. There highlights the word System on
JSystem.Xml.Sch ema.XmlSchemaFo rm.Unqualified and I can't figure out
Jwhy as System.Xml.Sche ma.XmlSchemaFor m.Unqualified is an enum, not a
Jnamespace.
JJ>
[System.Xml.Seri alization.XmlEl ementAttribute( Form=System.Xml .Schema.
JXmlSchemaForm. Unqualified)]
J>


Oct 31 '07 #4
For reference, theoretically you *can* use some tricks (alias, global
namespace, etc) to allow you to have properties called System etc -
but I really, really don't recommend it. Just mentioning for
completeness.

Marc
Nov 2 '07 #5
"Marc Gravell" <ma**********@g mail.comwrote in message
news:Op******** ******@TK2MSFTN GP02.phx.gbl...
For reference, theoretically you *can* use some tricks (alias, global
namespace, etc) to allow you to have properties called System etc - but I
really, really don't recommend it. Just mentioning for completeness.
Many years ago, when we were first moving our app to .NET, we had a lot of
discussion about what we would do with our "System". We've had this thing
we call a System for close to 20 years and the natural name would be System
but, that caused a lot of consternation. We finally decided to go ahead and
call it System and, we have no regrets. We didn't have to tell our
installed base that "Systems" are now called "Whatevers" and it doesn't
cause as much pain as we feared.

The biggest problem didn't come up until we converted to V2.0 of the
Framework and changed our string resources to use the resource editor in VS
2005, the code generated by the resource editor sticks a "using System;" in
our namespace which causes a collision. If they would just change that to
"using global::System; ", life would be good.

I wouldn't say I recommend it but, if it makes sense for you, do it! It
will work, which is a fine testament to the namespace design of the .NET
environment.
Nov 2 '07 #6

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

Similar topics

2
6399
by: Jacek Dziedzic | last post by:
Is it valid to use a "using namespace foo" (as opposed to using foo::bar which I'm sure is legal) within a class declaration? My compiler rejects it, but I've been told it's valid. Can anyone please confirm or deny? TIA, - J.
3
1682
by: janek | last post by:
I have a question: what differences are between: namespace Mary { int r = 5 ; char m ;
2
1594
by: Pete Hearn | last post by:
Hi For some reason, I cannot type "Using System.Web.Mail" in my ASP.Net app using intellisense. The dot after System offers me Web which I select, then another dot after Web does not put up another list. Typing it in manually chokes the compiler. Is there something I should have installed to enable the .Mail namespace? TIA
0
2986
by: maxim mat | last post by:
Hi I need to build client for web service. But when I'm using Visual Studio .NET to add Web Reference, I get error: "Custom tool error: Unable to import WebService/Schema. Unable to import binding 'controllerSoapBinding' from namespace 'http://Bla-Bla-Bla'. Unable to import operation 'getClient'. The datatype 'Array' is missing. " Some problem when I try to use wsdl.exe tool in .NET. I get: Schema validation warning: Type 'cww:Class' is...
0
1188
by: kevin_g_frey | last post by:
Hello We have an internal tool that generates a series of .NET class wrappers for accessing our database entities. One of our database entities is called "System" so our correspond __gc class is called System. All of our classes are declared in our own namespace X. We are getting an error message along the lines of: Error C2027: use of undefined type 'X::System'. SuppressFinalize
14
2175
by: Ronald S. Cook | last post by:
I'm just curious how you would handle this. In the cable industry, Comcast is referred to as an "MSO" (multiple systems operator) meaning they own many cable systems. Therefore a solution must be architected to accommodate "System" as an entity. This means a table in the database named System, a class System, a web form System, etc. Since System is such a reserved word, how should we do this? To rename it "CableSystem" would bug as...
4
5024
by: Peter Kanurer | last post by:
Assume I add in VisualCSharp 2005 References to Oracle.DataAccess AND System.Data.OracleClient to an application. Does this cause problems or can they co-exist in one application ?
0
2065
by: Schadrach | last post by:
I'm having a strange problem, I have a small executable that runs a backup for a some data nightly, and as of September 22, 2007 it has ceased to function with the following error: Unhandled Exception: System.TypeInitializationException: The type initializer for "System.Threading.Thread" threw an exception. ---> System.ArgumentOutOfRangeException: Load factor needs to be between 0.1 and 1. Parameter name: loadFactor at...
2
16446
by: shalong | last post by:
Hi all, VS 2008 is complaining that HttpWebRequest class is not in System.Net namespace I have referenced System.Net and have coded "using System.Net" I think its a setup problem rather than a coding error The type or namespace name 'HttpWebRequest' does not exist in the namespace 'System.Net' (are you missing an assembly reference?) C:\Documents and Settings\user\My Documents\Visual Studio...
0
8946
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9447
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9235
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9181
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8186
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6735
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4550
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
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

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.