Avatar of jazzIIIlove
jazzIIIlove
Flag for Sweden asked on

how to from a project, reaching to the other project in C#?

Hi there;

I got a solution having 2 projects. What I tried to do is using the project1's class and related function in the project2.

I build the project1 and add the executable of project1 as reference to the project2, and then in the project2, trying to import the project1 as

using project2;

But simply above statement is not recognized. what to do?

My other related problem is that:
Both apps are Console application. That, in fact I need only one Main in my program but couldn't solve it out how to do when there are several applications in a solution

Kind regards.
C#

Avatar of undefined
Last Comment
kaufmed

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
kaufmed

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
jazzIIIlove

ASKER
ok, you explained it extremely well, that I got a couple of related questions;

1) Should I remove the main function or the Program.cs (deleting Program.cs) as I don't require?
2) Ok for dll and its import to my project, no problem. But, why am I also using the "using" statement?

3) and when I change the name of the project, it seems namespace is not updated automatically. Is it safe to update the namespace manually or why isn't updated when change the name of the project?

Kind regards.
SOLUTION
kaufmed

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
jazzIIIlove

ASKER
You are amazing...
jazzIIIlove

ASKER
Spectacular interest, genuine expert

There is  an definite art of the comments of the expert.
Your help has saved me hundreds of hours of internet surfing.
fblack61
kaufmed

Too kind, sir. Glad to help  = )