PC Review


Reply
Thread Tools Rate Thread

assembly / class library question

 
 
Rainer Queck
Guest
Posts: n/a
 
      23rd Feb 2007
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


 
Reply With Quote
 
 
 
 
Sourcerer
Guest
Posts: n/a
 
      23rd Feb 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>


 
Reply With Quote
 
Rainer Queck
Guest
Posts: n/a
 
      23rd Feb 2007
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" <(E-Mail Removed)> schrieb im Newsbeitrag
news:ermhj3$7gj$(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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
>>

>



 
Reply With Quote
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      26th Feb 2007
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 ((E-Mail Removed), 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.

 
Reply With Quote
 
Rainer Queck
Guest
Posts: n/a
 
      26th Feb 2007
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/library/ms185319(VS.80).aspx

Just updated my class template, so I won't have the problem any more.

Regards
Rainer


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Icons in dll / assembly / class library KS Microsoft Dot NET 1 7th May 2009 10:04 AM
Preventing others from using my class library assembly. Sin Jeong-hun Microsoft C# .NET 7 22nd Jun 2007 06:52 AM
my class library doesn't contain an assembly - how to add an assem =?Utf-8?B?UmljaA==?= Microsoft VB .NET 3 16th Nov 2006 08:18 PM
Re: class library dll assembly physical location Mattias Sjögren Microsoft C# .NET 1 20th Jul 2004 07:14 AM
What is the application path for class library assembly? =?Utf-8?B?Q2hyaXM=?= Microsoft ADO .NET 4 3rd Feb 2004 07:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:11 PM.