Click to See Complete Forum and Search --> : namespace could not be found problem


yeap7
December 11th, 2008, 03:10 AM
Hi

strange thing..
I created an empty solution then added a web page (UI) and a class library (BL)
I added a reference to the UI and I can see BL.dll and BL.pdb under the Bin folder of the web page . when I try to refer to BL in the web page I get the error :
error CS0246: The type or namespace name 'BL' could not be found (are you missing a using directive or an assembly reference?)
It is very starnge because I added references of class lib before..
and when i load an old project that used to work.. I get the same error !
what happened..?

Thanks

nabeelisnabeel
December 12th, 2008, 04:35 AM
Suppose you have a class named ABC and namespace XYZ in the BL.dll and you are trying to access it using ABC in your source code. Now youhave two ways to access your class.

1- Write 'using' statement in the start of your file declaring the namespace of your ABC class.
2- Access your class with full qualified name i.e. XYZ.ABC

yeap7
December 14th, 2008, 04:04 AM
Thx
I re-installed VS and now it works..