Added a .Net Reference, error message "the type or namespace cannot be found"  
Author Message
Marci Weinberger





PostPosted: Visual C# General, Added a .Net Reference, error message "the type or namespace cannot be found" Top

Hi All,

I am sorry to bother you all with a stupid question, but I installed a new custom .Net control. I then opened up one of the example projects and tried to compile. I am receiving the same message, "the type or namespace cannot be found". VS05 throws up an exclamation symbol next to the reference. I got the same problem, when I opened up a project of my own, added the reference and then added a couple of lines to use the new object.

How does the build engine (compiler, linker, whatever) know about the location With VB6 the installation of a COM object and then registering the control is all that is needed. Do I need to do something different here

Thanks in advance,

Marci Weinberger


Visual C#12  
 
 
cverdon





PostPosted: Visual C# General, Added a .Net Reference, error message "the type or namespace cannot be found" Top

Hi,

There are two possible locations for the assemblies: the GAC and the filesystem.

The GAC is a global registry of assemblies where applications looks first, then filesystem locations such as the startup folder, windows, system32, etc is searched.

For your problem, try removing all reference to this lib in all projects, copy the dll in a subdirectory lib of your project and add a reference to this copy of the dll.

Good luck,
Charles


 
 
Marci Weinberger





PostPosted: Visual C# General, Added a .Net Reference, error message "the type or namespace cannot be found" Top

Adding the DLL to a subfolder and then adding that version of the DLL to the references worked. Thanks!

Marci Weinberger