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()
Step 1: Make a reference from Project A to B. Step 2: Make Project B's Program. cs Public by adding the word "public" in front of "class Program". Step 3) Make a public method returnPath().
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. Can't believe how difficult some of the other answers made this. Thank you!
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With