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 4 1492
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******** ******@TK2MSFTN GP03.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
Hi Nilola,
thanks for anwering.
I did exactly as you described it.
From the tabs in the "AddReferen ce" 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****@MAKNIgm ail.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******** ******@TK2MSFTN GP03.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
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.
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 that I can handle to go
through my assembly and invoke the static initializer on each relevant
class. This way, everything that needs to be registered will be registered
before the first request to the registry object.
So my questions are:
|
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 to the assembly. When I try to create an instance
of the class, it returns a null value.
Any help would be appreciated.
|
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
body) of the method? Does this occur when "Main" is build or does it happen
when main is loaded and Jitted? Also is the linking achieved by the full
method name( this is what is seen in the IL generated by ILDASM : e.g : call
|
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 shared back-end library
code that they use.
I now have a need to create 2 new separate small assemblys from the same
code base, with one public entry point in each. For example I want to bundle
2 public server controls, each into their own...
|
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 from
'c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET
Files\root\1f575646\ad3a161b\assembly\dl2\57ca505e\044565c0_f84fc401\Test1.DLL'
The problem is that the control is defined in two different assemblies
| |
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 somewhere that each folder under the "web site" is compiled in
separate assembly. I however, did not find that the "web site" creation in
vs.net 2005 created any AssemblyInfo.cs file.
|
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 business layer) I created a
class which inherits from a base class in the first assembly....so far so
good.
If I create a third assembly (my UI layer) and add reference in it to the
business layer and I access a public variable in the business...
|
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", which is something
like I attached below. Would anyone please let me know what is the
purpose of this file? Or are there any equivalent stuff I can imagine
in C++ or Java?
Thanks a lot.
|
by: Kevin Frey |
last post by:
I have the following situation:
Assembly #1:
class NativeSearchCriteria // NOTE: a native class
{
};
public ref class TheBaseClass
{
|
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 a strong name key file using sn tool.
2.In the Class Library Project (I am using VS 2005)
2.1 Select "Register For COM" in the Project Properties
2.2 Inside assemblyinfo.cs set COMVISIBLE to True
2.3 Assign strong name key file to the assembly...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |