Multi-Project Solution Link

I am new to all this.  I have put two projects into a solution.  One contains several functions and classes.  The other project just creates a window to execute them via a start button.  I added a reference in the window project to the project with the classes and functions.  However, I am unable to execute from the start button code a class located in the second project.  Am I missing some link or something


Answer this question

Multi-Project Solution Link

  • krick

    If you have the class libary added as a reference

    then you should be able to do the following.

    Dim listenObj as new RouterListener.StrListen
    listenObj.Ports() ' function with in the class project.

    The first line will instantiate a new ListenObj object of the type RouterListener.StrListen which is the fully qualified path name of your class in the classlibrary.

    Let me know if that helps.


  • Facri

    You are correct the one project was a Class project and the other was a Window/Form project.  I did add the Reference as a Project Reference too.  I added the project reference into the WindowsForms Project References.

    Then perhaps it is the way I am coding the initiation from the start button.  Like I said, I'm new to this. 

    The Class project is call "RouterListener" and the vb class that is within it is called "StrListen" which is public.  Other Functions follow within the Class project.

    The Form project is called "Listener Window Project" with a form called "ListenerForm".

    In the Start button of the ListenerForm I coded:

    Dim listenObj = RouterListener.StrListen

    listenObj.Ports()  ' function with in the class project.

     

    It does not recognize what RouterListener.StrListen is in my Dim statement.  Says it is undeclared.

     

     

     

     



  • R Shams

    The solution was:

    The RouterListener (2nd project) was a converted project from 2003 to 2005. In that process a defaulted NameSpace is created. By changing the defaulted namespace to the name of the class solved the problem.

    Thanks for your help



  • ehartwell_mtm

    I would assume that the project that contains several functions and classes is set up as a class library project.

    In the windows project when you added the reference did you add it as a project reference.

    In the solution explorer - select the windows project and right click and select "Set as start Project".

    This should then work.


  • Multi-Project Solution Link