How to call in a major project other added as a reference in C #?

I have several designs and want to make a form with buttons and call them. Searching saw that I can do this by adding another project as a reference, but I could just add one, could not all. How do after you add the project as reference? As you call it via a button?

Is a UDP client and server with, both screens are different projects in Console. With WindowsForm screens I have an RPC and TCP, both are also different projects. None of these projects are web, are executable.
Who is Participating?
If I am understanding your question properly, you want to know how you can call functions from a referenced assembly?  If this is what you are after, then you need to understand a couple of things (trying to keep this very basic).

First, is Pathing - It is called this because it resembles a path.  The path is essentially defined as such Assembly --> Namespace --> Class --> Method/Property.  The Assembly portion of the path is satisfied by the reference.  After which you would specify a namespace (or multiple).  Once you have specified the namespace(s), then you can instantiate the class (so long as it is visible to your calling code), if needed.  Once you have access to the class, you can then access any visible members of the class (methods, properties, etc.).

The second, is visibility.  Visibility is what determines how a class/method/variable/property can be accessed with public being the least restrictive and private being the most restrictive.  The visibility definitions are:
public - The type or member can be accessed by any other code in the same assembly or another assembly that references it.
protected - The type or member can be accessed only by code in the same class or struct, or in a class that is derived from that class.
protected internal - The type or member can be accessed by any code in the assembly in which it is declared, or from within a derived class in another assembly. Access from another assembly must take place within a class declaration that derives from the class in which the protected internal element is declared, and it must take place through an instance of the derived class type.
internal - The type or member can be accessed by any code in the same assembly, but not from another assembly.
private - The type or member can be accessed only by code in the same class or struct.

Knowing this, what you would do after you add the reference to the project is access it's members by way of the Namespace that is defined in the project:Object browser view of two separate projects.  Project2 is referenced by Project1.Note that IAmAProject2PublicClass is the only *visible* method for me to instantiate.-saige-
The author wanted to know how to reference members from another project/assembly.  I showed the author that it was possible and provided clarifying information to that affect.


Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.