+ 1

c#

how to use method of a project in a different project namespaces are different thanks

28th Jun 2017, 1:41 AM
muhamad hardaniyan
muhamad hardaniyan - avatar
4 Respuestas
+ 2
Assuming these projects are in the same solution, simply add reference to P1 from P2. 1. In the 'Solution Explorer' tree, expand the P2 project and then right-click the project and select 'Add Reference' from the menu. 2. On the 'Add Reference' dialog, select the 'Projects' tab and select your P1 project. 3. If you are using namespaces then you will need to import the namespaces for your P1 types by adding 'using' statements to your files in P2. Note that the types in P1 that you wish to access directly must have a sufficient access level: typically this means they must be made public.
28th Jun 2017, 2:24 AM
Nobody
+ 1
thanks so much you gave me good idea
28th Jun 2017, 2:43 AM
muhamad hardaniyan
muhamad hardaniyan - avatar
+ 1
If there is a .dll from a build, you could try manually adding the reference into the projects .xml file and reloading the solution. Just be careful because that's easy to mess up. The latest versions of Visual Studios should support the above method.
28th Jun 2017, 3:33 AM
Nobody
0
if solotion explore are different ?
28th Jun 2017, 3:27 AM
muhamad hardaniyan
muhamad hardaniyan - avatar