473,513 Members | 2,493 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

assembly / class library question

Hello NG,

I started to build me a little class library.
This library I added to a Project which also surves me to test the library.
This library holds a namespace:
namespace <myLib>.<some function>

Now I added a extended Namespace to my library like:
namespace <myLib>.<some other function>

building this dll is no problem, but in the project the new namespace is not
recognized. Why?
if I open the the dll by double click in my project links the object browser
shows <myLib>[Runtime = v2.0.50727] and the
namespace <myLib>.<some function>.
namespace <myLib>.<some other functionis missing....

Thanks for help and hints...
Rainer Queck
Feb 23 '07 #1
4 1485
You need to add it. Right-click "references" in Solution Explorer, under the
project where you are using your library, then click "Add Reference". Find the
DLL you compiled and click OK (look through the tabs, and find the one that is
most appropriate for your situation, i.e. whether the library is a project in
this solution, or you want to browse for the library, etc.).

In the file where you want to use that library, just add line:

using <myLib>;

And voilla.

Nikola

--
"It is easy in the world to live after the world's opinion; it easy in solitude
to live after our own; but the great man is he who in the midst of the crowd
keeps with perfect sweetness the independence of solitude."
Ralph Waldo Emerson, Self-reliance 1841
http://pinpoint.wordpress.com/

"Rainer Queck" <Ra****@noemail.noemailwrote in message
news:uj**************@TK2MSFTNGP03.phx.gbl...
Hello NG,

I started to build me a little class library.
This library I added to a Project which also surves me to test the library.
This library holds a namespace:
namespace <myLib>.<some function>

Now I added a extended Namespace to my library like:
namespace <myLib>.<some other function>

building this dll is no problem, but in the project the new namespace is not
recognized. Why?
if I open the the dll by double click in my project links the object browser
shows <myLib>[Runtime = v2.0.50727] and the
namespace <myLib>.<some function>.
namespace <myLib>.<some other functionis missing....

Thanks for help and hints...
Rainer Queck
Feb 23 '07 #2
Hi Nilola,

thanks for anwering.
I did exactly as you described it.
From the tabs in the "AddReference" I selected "browse" and then selected
<mylib>.dll
But still I can't get to the namespace!

But in the meanwhile I found the problem.
I added a new Class and VS by default does not add "public" in front of the
class !
instead of
public class <myClass>
{
}
it only creates
class <myClass>
{
}
Thereby the class was not public and I could not access it from within my
project.

Well, thats live....

Regards
Rainer
I checked with
"Sourcerer" <en****@MAKNIgmail.comschrieb im Newsbeitrag
news:er**********@ss408.t-com.hr...
You need to add it. Right-click "references" in Solution Explorer, under
the project where you are using your library, then click "Add Reference".
Find the DLL you compiled and click OK (look through the tabs, and find
the one that is most appropriate for your situation, i.e. whether the
library is a project in this solution, or you want to browse for the
library, etc.).

In the file where you want to use that library, just add line:

using <myLib>;

And voilla.

Nikola

--
"It is easy in the world to live after the world's opinion; it easy in
solitude to live after our own; but the great man is he who in the midst
of the crowd keeps with perfect sweetness the independence of solitude."
Ralph Waldo Emerson, Self-reliance 1841
http://pinpoint.wordpress.com/

"Rainer Queck" <Ra****@noemail.noemailwrote in message
news:uj**************@TK2MSFTNGP03.phx.gbl...
>Hello NG,

I started to build me a little class library.
This library I added to a Project which also surves me to test the
library.
This library holds a namespace:
namespace <myLib>.<some function>

Now I added a extended Namespace to my library like:
namespace <myLib>.<some other function>

building this dll is no problem, but in the project the new namespace is
not recognized. Why?
if I open the the dll by double click in my project links the object
browser shows <myLib>[Runtime = v2.0.50727] and the
namespace <myLib>.<some function>.
namespace <myLib>.<some other functionis missing....

Thanks for help and hints...
Rainer Queck

Feb 23 '07 #3
Hi Rainer,

Glad to know you've found the cause of the issue and sharing your
experience here.

The default class template is not using a public accessor. If you found
that you frequently need to tweak a new class, it's easy to update existing
templates by following this article:

#How to: Update Existing Templates
http://msdn2.microsoft.com/en-us/lib...19(VS.80).aspx

Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Feb 26 '07 #4
Hi Walter,

thanks for the hint.
The default class template is not using a public accessor. If you found
that you frequently need to tweak a new class, it's easy to update
existing
templates by following this article:

#How to: Update Existing Templates
http://msdn2.microsoft.com/en-us/lib...19(VS.80).aspx
Just updated my class template, so I won't have the problem any more.

Regards
Rainer
Feb 26 '07 #5

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

Similar topics

6
4795
by: Outshined | last post by:
I have a class library where just about every class uses its static initializer to register with a central registry object in the same assembly. I am hoping for some sort of Assembly.Load event...
4
11666
by: David Elliott | last post by:
I am trying to load an assembly and execute a method from a class. I have listed 3 parts to the code. 1) The Driver to load and execute 2) The Interface 3) The assembly I have a valid referece...
3
2544
by: Atul Godbole | last post by:
Suppose an assembly "Main" is using class "A" from another Assembly "Dep" as follows : A a = new A(); a.MethodOne(); At what time is the call to MethodOne linked to the actual MSIL (method...
8
1423
by: Donal McWeeney | last post by:
I have a big Visual Studio class library project from which I create an assembly. This assembly for example might contain 100 public entry points (for example custom server controls) and a load of...
3
3333
by: Dan | last post by:
Hi, I have a problem using an aspx page with a Control on it. I get the following error message Compiler Error Message: CS1595: 'Test.Class2' is defined in multiple places; using definition...
10
3416
by: jojobar | last post by:
Hello, I am trying to use vs.net 2005 to migrate a project originally in vs.net 2003. I started with creation of a "web site", and then created folders for each component of the site. I read...
2
2295
by: Brad | last post by:
I have one of those seemingly simple questions that evades/confuses me. I've created an assembly with bass classes (classes meant to be inherited in other assemblys). In a secondary assembly (my...
2
11758
by: Paul | last post by:
Hi, I have experience in Java and C++ but I am rather new to C# and just started learning it. I am using Visual C# 2005 Express Edition and I found that there is a file called "AssemblyInfo.cs",...
4
2344
by: Kevin Frey | last post by:
I have the following situation: Assembly #1: class NativeSearchCriteria // NOTE: a native class { }; public ref class TheBaseClass {
1
1549
by: divya | last post by:
Hi, I made an assembly (class library project) in Dot net and wanted the assembly to have COM interoperability successfully got the assembly working with VB6 performing following steps: 1.Create...
0
7384
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,...
1
7101
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
5686
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,...
1
5089
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
4746
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
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1596
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 ...
1
802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
456
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...

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.