I've two class libraries, where one is referencing the other.
The first library looks like this; (assembly name and root name space is set to Codab.Parser)
namespace Codab.Parser
{
public class Parser
{...}
...
}
The second library looks like this (assemble name and root name space is set to Codab.TapNet)
using Codab.Parser;
namespace Codab.TapNet
{
public class FileExport
{
private Parser = fParser;
}
...
}
My problem is that I can't access the Parser class directly (I receive the message 'Codab.Parser' is a 'namespace' but is used like a 'type') in the second library. I really don't want to use full names when accessing this class or something else in this library.
If I change the namespace to something like "Codabxx" it works!
Can somebody please explain what is going wrong.
Thanks
Robert Warnestam 6 24724
1. The name of the namespace and the name of the class are the same
(Parser).
2. There's no variable name... you don't declare "private int = 3", but
"private int myCounter = 3"
When you're referencing Parser in your declaration, the compiler is
referencing Codab.Parser, not Codab.Parser.Parser...
To fix this, you could remove the "using Codab.Parser" and then in the
variable declaration put
private Codab.Parser.Parser myParser = fParser;
HTH
Dan.
---------------------------------------------------------------
"Robert Warnestam" <rw@codab.se> wrote in message
news:eI**************@TK2MSFTNGP15.phx.gbl...
I've two class libraries, where one is referencing the other.
The first library looks like this; (assembly name and root name space is set
to Codab.Parser)
namespace Codab.Parser
{
public class Parser
{...}
...
}
The second library looks like this (assemble name and root name space is set
to Codab.TapNet)
using Codab.Parser;
namespace Codab.TapNet
{
public class FileExport
{
private Parser = fParser;
}
...
}
My problem is that I can't access the Parser class directly (I receive the
message 'Codab.Parser' is a 'namespace' but is used like a 'type') in the
second library. I really don't want to use full names when accessing this
class or something else in this library.
If I change the namespace to something like "Codabxx" it works!
Can somebody please explain what is going wrong.
Thanks
Robert Warnestam
Hi,
In addition to Dan's answer, i can recommend you to use name
of namespaces different than name of its classes.
Elswere you've got to write full class name (every time)
to make that class visible in VS (or c# compiler)...
But i think that its boring so much :-(
HTH
Marcin 1. The name of the namespace and the name of the class are the same (Parser). 2. There's no variable name... you don't declare "private int = 3", but "private int myCounter = 3"
When you're referencing Parser in your declaration, the compiler is referencing Codab.Parser, not Codab.Parser.Parser...
To fix this, you could remove the "using Codab.Parser" and then in the variable declaration put private Codab.Parser.Parser myParser = fParser;
HTH
Dan.
--------------------------------------------------------------- "Robert Warnestam" <rw@codab.se> wrote in message news:eI**************@TK2MSFTNGP15.phx.gbl... I've two class libraries, where one is referencing the other.
The first library looks like this; (assembly name and root name space is set to Codab.Parser) namespace Codab.Parser { public class Parser {...} ... } The second library looks like this (assemble name and root name space is set to Codab.TapNet) using Codab.Parser; namespace Codab.TapNet { public class FileExport { private Parser = fParser; } ... } My problem is that I can't access the Parser class directly (I receive the message 'Codab.Parser' is a 'namespace' but is used like a 'type') in the second library. I really don't want to use full names when accessing this class or something else in this library. If I change the namespace to something like "Codabxx" it works!
Can somebody please explain what is going wrong.
Thanks
Robert Warnestam
Thanx for the reply
1) Yes they are the same.
2) Typing error, of course it should be "private Parser fParser;" instead
I know I can use fullnames, but that is not what I want.
/Robert
"Dan Bass" <danielbass [at] postmaster [dot] co [dot] uk> skrev i
meddelandet news:eu*************@TK2MSFTNGP12.phx.gbl... 1. The name of the namespace and the name of the class are the same (Parser). 2. There's no variable name... you don't declare "private int = 3", but "private int myCounter = 3"
When you're referencing Parser in your declaration, the compiler is referencing Codab.Parser, not Codab.Parser.Parser...
To fix this, you could remove the "using Codab.Parser" and then in the variable declaration put private Codab.Parser.Parser myParser = fParser;
HTH
Dan.
--------------------------------------------------------------- "Robert Warnestam" <rw@codab.se> wrote in message news:eI**************@TK2MSFTNGP15.phx.gbl... I've two class libraries, where one is referencing the other.
The first library looks like this; (assembly name and root name space is set to Codab.Parser) namespace Codab.Parser { public class Parser {...} ... } The second library looks like this (assemble name and root name space is set to Codab.TapNet) using Codab.Parser; namespace Codab.TapNet { public class FileExport { private Parser = fParser; } ... } My problem is that I can't access the Parser class directly (I receive the message 'Codab.Parser' is a 'namespace' but is used like a 'type') in the second library. I really don't want to use full names when accessing this class or something else in this library. If I change the namespace to something like "Codabxx" it works!
Can somebody please explain what is going wrong.
Thanks
Robert Warnestam
Thanx for your reply.
Yes it's boring too write the fullname!!!
I tried to change the namespace of the second assembly, this was the result;
Changing the namespace to "Codab.Somethingelse" does not work
Changing the namespace to "BlaBla.TapNet"
And of course I can't accept to change the root of the namespace to
something different than our company. The strange thing is that I have a
similar situation in another part of my solution - and it works!!! I'm using
VS2005 - could it be a bug?
/Robert
"Marcin Grzębski" <mg*******@taxussi.no.com.spam.pl> skrev i meddelandet
news:cr**********@atlantis.news.tpi.pl... Hi,
In addition to Dan's answer, i can recommend you to use name of namespaces different than name of its classes. Elswere you've got to write full class name (every time) to make that class visible in VS (or c# compiler)... But i think that its boring so much :-(
HTH Marcin
1. The name of the namespace and the name of the class are the same (Parser). 2. There's no variable name... you don't declare "private int = 3", but "private int myCounter = 3"
When you're referencing Parser in your declaration, the compiler is referencing Codab.Parser, not Codab.Parser.Parser...
To fix this, you could remove the "using Codab.Parser" and then in the variable declaration put private Codab.Parser.Parser myParser = fParser;
HTH
Dan.
--------------------------------------------------------------- "Robert Warnestam" <rw@codab.se> wrote in message news:eI**************@TK2MSFTNGP15.phx.gbl... I've two class libraries, where one is referencing the other.
The first library looks like this; (assembly name and root name space is set to Codab.Parser) namespace Codab.Parser { public class Parser {...} ... } The second library looks like this (assemble name and root name space is set to Codab.TapNet) using Codab.Parser; namespace Codab.TapNet { public class FileExport { private Parser = fParser; } ... } My problem is that I can't access the Parser class directly (I receive the message 'Codab.Parser' is a 'namespace' but is used like a 'type') in the second library. I really don't want to use full names when accessing this class or something else in this library. If I change the namespace to something like "Codabxx" it works!
Can somebody please explain what is going wrong.
Thanks
Robert Warnestam
Robert,
In that case you should insure the namespace and class name are different.
Thanks.
Dan.
"Robert Warnestam" <rw@codab.se> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl... Thanx for the reply
1) Yes they are the same. 2) Typing error, of course it should be "private Parser fParser;" instead
I know I can use fullnames, but that is not what I want.
/Robert
"Dan Bass" <danielbass [at] postmaster [dot] co [dot] uk> skrev i meddelandet news:eu*************@TK2MSFTNGP12.phx.gbl... 1. The name of the namespace and the name of the class are the same (Parser). 2. There's no variable name... you don't declare "private int = 3", but "private int myCounter = 3"
When you're referencing Parser in your declaration, the compiler is referencing Codab.Parser, not Codab.Parser.Parser...
To fix this, you could remove the "using Codab.Parser" and then in the variable declaration put private Codab.Parser.Parser myParser = fParser;
HTH
Dan.
--------------------------------------------------------------- "Robert Warnestam" <rw@codab.se> wrote in message news:eI**************@TK2MSFTNGP15.phx.gbl... I've two class libraries, where one is referencing the other.
The first library looks like this; (assembly name and root name space is set to Codab.Parser) namespace Codab.Parser { public class Parser {...} ... } The second library looks like this (assemble name and root name space is set to Codab.TapNet) using Codab.Parser; namespace Codab.TapNet { public class FileExport { private Parser = fParser; } ... } My problem is that I can't access the Parser class directly (I receive the message 'Codab.Parser' is a 'namespace' but is used like a 'type') in the second library. I really don't want to use full names when accessing this class or something else in this library. If I change the namespace to something like "Codabxx" it works!
Can somebody please explain what is going wrong.
Thanks
Robert Warnestam
Try:
using CodabParser=Codab.Parser.Parser;
....
private CodabParser fParser=new CodabParser(...);
But I agree that fixing up your namespace/classname issue would probably be
a better solution in the long run.
"Robert Warnestam" wrote: I've two class libraries, where one is referencing the other.
The first library looks like this; (assembly name and root name space is set to Codab.Parser) namespace Codab.Parser { public class Parser {...} ... } The second library looks like this (assemble name and root name space is set to Codab.TapNet) using Codab.Parser; namespace Codab.TapNet { public class FileExport { private Parser = fParser; } ... } My problem is that I can't access the Parser class directly (I receive the message 'Codab.Parser' is a 'namespace' but is used like a 'type') in the second library. I really don't want to use full names when accessing this class or something else in this library. If I change the namespace to something like "Codabxx" it works!
Can somebody please explain what is going wrong.
Thanks
Robert Warnestam This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Tim Tyler |
last post by:
PHP puts most of its functions into a big flat global namespace.
That leads to short function names - but creates a namespace
minefield for programmers.
Lots of the functions are legacies from...
|
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...
|
by: Kevin Newman |
last post by:
I've been toying with a namespace manager, and wanted to get some input.
So what do you think?
if (typeof com == 'undefined') var com = {};
if (!com.unFocus) com.unFocus = {};
...
|
by: Tiraman |
last post by:
Hi,
I Build my own dll with my own namespace name and i would like to put it in
one place but for the project bin folder
so all of the projects will be able to use it .
i tried to put the dll...
|
by: Charles Leonard |
last post by:
I need opinions regarding Web Service Namespace usage and/or suggestions
regarding how to handle deployment.
Our web service application will exist in two different domains and is
likely to...
|
by: Pathogenix |
last post by:
Greetings,
I'm trying to fix a web service client which has been implemented in a
dailywtf worthy manner. I've decided to rip all the old code
out and start again from the proxy generated by...
|
by: Kevin Newman |
last post by:
The primary problem I've had with php is the lack of namespaces, which
makes OOP very difficult to organize, since you end up with large number
of classes cluttering up the same namespace - which...
|
by: TotySantana |
last post by:
Now i am trying to change the namespace for the web page class by putting the page class between namespace myCustomNameSpace {} , but when i do this with a web page class i got the following error
...
|
by: bogus1one |
last post by:
Hi All
Given the following:
// NamespaceTemplate.cpp : Defines the entry point for the console
application.
//
#include "stdafx.h"
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |