assembly / class library question

R

Rainer Queck

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 function> is missing....

Thanks for help and hints...
Rainer Queck
 
S

Sourcerer

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/
 
R

Rainer Queck

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 said:
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 said:
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 function> is missing....

Thanks for help and hints...
Rainer Queck
 
W

Walter Wang [MSFT]

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/library/ms185319(VS.80).aspx

Regards,
Walter Wang ([email protected], 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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top