RadhaKrishnaKiJaya
asked on
Use class from different Project and Solution
Hello Experts,
I have a Class A in Project A. I have a Project B too. Project B would like to use some methods from Class A. How can I do that.
Note: I am using ASP.NET and C# in Visual Studio 2015
Thank you!
I have a Class A in Project A. I have a Project B too. Project B would like to use some methods from Class A. How can I do that.
Note: I am using ASP.NET and C# in Visual Studio 2015
Thank you!
In Project B you use Project A as Reference
Project A has to be of type "class library. Then in Project B, add a reference to Project A and it will be available.
ASKER
Thank you John Tsioumpris for your quick reply.
I forgot to mention that, they have different solutions too. Please let me know.
Thank you!
I forgot to mention that, they have different solutions too. Please let me know.
Thank you!
A solution is a group of projects. A project can be added to multiple solutions.
If you don't need to debug your classes of ProjectA while working in Project B, you can add a reference to the compiled DLL of project A.
If you don't need to debug your classes of ProjectA while working in Project B, you can add a reference to the compiled DLL of project A.
ASKER
Thank you Éric,
I am looking at it and update here soon.
Thank you!
I am looking at it and update here soon.
Thank you!
ASKER
Eric,
1. I need to Debug the code once the Reference is added. How can I do that? Is there an alternative way?
2. The Add Reference is missing from Solution Explorer when I right click it. I can see it when I right click on Projects --> Add --> Reference. Not sure if this is the right way.
Please let me know if I am missing anything.
Thank you!
1. I need to Debug the code once the Reference is added. How can I do that? Is there an alternative way?
2. The Add Reference is missing from Solution Explorer when I right click it. I can see it when I right click on Projects --> Add --> Reference. Not sure if this is the right way.
Please let me know if I am missing anything.
Thank you!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you Eric for your timely help.