user1316502
user1316502

Reputation: 879

Calling methods from different Projects in one Solution

There are 3 Projects in 1 Solution. Main manipulations I make from the main file in the 1st Project. However I need to call methods and use classes from the 3rd Project. For example:

– 3rd Project has:

public DataClasses1DataContext() :     base(global::WindowsFormsApplication1.Properties.Settings.Default.mediaBorshchConnectionString, mappingSource)
 { OnCreated(); } 

What is the right way to call it from my 1st Project?

DataClasses1DataContext borshch = new DataClasses1DataContext()

Upvotes: 22

Views: 67041

Answers (1)

Jacob
Jacob

Reputation: 78920

You need to add a reference to the 3rd project in your 1st project. To do this, right-click on your project, select "Add Reference," then select the project in your solution. Once your main project references the 3rd project, then you can access its public types.

Upvotes: 38

Related Questions