locked
All classes are not accessible in Namespace RRS feed

  • Question

  •  

    I'm facing a very strange problem. I have a multiple Projects solution say Solution1 which is having different namespaces based on my requirement.

     

    I created another solution say Solution2 which is also having multiple projects from which I set a ref to the

     

    Solution1->Firstproject

     

    to access some functionality from there.

     

    Surprisingly, many of my classes are not being shown in the Solution2 , I tried many things but result is same.

     

    Can anybody help me on this.

    Monday, December 31, 2007 3:12 PM

Answers

  • Check the timestamp on the assembly to make sure it's a recent one.

    Wednesday, January 2, 2008 3:50 PM

All replies

  • Did you put a using clause to the namespace which contains the classes you want to use? If so, are the classes you want to use public?

     

    Monday, December 31, 2007 3:16 PM
  • Yes, I tried that also. I have tried to put the reference path also & tried global:: also but still result is same.

     

    Classes are public, bcos as I mentioned I'm already using it in Solution1 which is having multiple projects and I'm using the functionality of one project from another without any issues.

     

    The only difference now is that I want to use the functionality from another solution.

     

    Do you have any clue or hint on what can be wrong.

     

    Monday, December 31, 2007 3:33 PM
  • Let me make sure I've got this. You added a reference the dll or exe produced from Solution1.FirstProject in a project within Solution2, and some of the public classes contained within FirstProject cannot be accessed in the project within Solution2?
    Monday, December 31, 2007 7:56 PM
  • Yes, this is correct.

     

    It is a Dll file and i'm setting reference to the file generated in the debug directory.

     

    This dll is having more then 20 classes and out of which only 3-4 classes are visible !! Infact I'm not even able to see some nested namespaces also.

     

    I'm using this same dll from Solution1 without any issues, the only difference in that case is that bcos it is in the same solution I have set a project reference whereas in Solution2 I have browsed to the debug dir and set and reference to the dll.

     

    Infact, even the Object browser is showing the same thing what intellisense is showing.

     

    If this is not solved then my only options will be to use reflection !!! or I will have to merge these 2 solutions !! Both these solutions are not good but I'm not able to figure out anything else.

     

    Is this a bug ?? I have installed all the updates of VS as well as windows so there are no such issues that system is not updated. 

    Tuesday, January 1, 2008 1:24 PM
  • Can you take a look at the assembly with reflector and ensure your classes are visible and public?

    Wednesday, January 2, 2008 3:44 AM
  • Hi,

     

    Does the Object browser only show limited public classes?

    And I would be glad if you post the class declarations in Solution1.FirstProject.

     

    Thanks!

     

    Wednesday, January 2, 2008 8:01 AM
  •  

    I checked in Reflector. Most of the classes are visible in that. But one namespace alongwith the classes contained in it are completely missing. There are two things which I noticed:

     

    1. Reflector is showing some classes as internal whereas I rechkd and classes are declared as public not internal.

    2. Reflector is showing namespaces as

     

    OM.BO.Order

     

    instead of

     

    OM.BO.OrderNs

     

    These name changing I did intentionally as there is a Order class in OM.BO.OrderNs namespace so to avoid any conflicts I have changed namesapce.

     

    Reflector is atleast showing more classes then Object browser. I will give the details on how this is implemented.

     

    Namespace are as follows :

     

    OM.BO.OrderNs [Stands for Order Management->Business Objects->Order Namespace], This is main namespace. 3 classes in this namespace are visible in Object Browser.

     

    Following are all the namespaces

     

    OM.BO.OrderNs.ContactNs

    OM.BO.OrderNs.FabAccNs [This namespace and all its classes are completely missing]

    OM.BO.OrderNs.PONs

     

    here is a sample of some of the classes which I have declared.

     

    [Serializable()]

    public class Contact : BusinessBase<Contact>

    {

    // Code goes here

    }

     

     

    [Serializable()]

    public class FabAccMainItems : BusinessListBase<FabAccMainItems, FabAccMain>

    {

    // Code goes here

    }
    Wednesday, January 2, 2008 8:51 AM
  • Check the timestamp on the assembly to make sure it's a recent one.

    Wednesday, January 2, 2008 3:50 PM
  •  

    Bravo !!! Finallly this is solved. Thanks a Lotttttttttttt...

     

    You are correct. Previously I was using the Debug configuration and changed it long back to release mode so by mistake I was referring to a many months old dll file.

     

    Thanks for all your help.

    Wednesday, January 2, 2008 4:10 PM