2 projects 1 class
-
I have one solution with two projects (project A & project B). Is there a way to "reference" a class in A from within B? If I'm in project B and from the solution's explorer I choose "Add Existing Item" it copies the file from A's physical directory into B's directory. I'm sorta trying to forward reference the class.
-
I have one solution with two projects (project A & project B). Is there a way to "reference" a class in A from within B? If I'm in project B and from the solution's explorer I choose "Add Existing Item" it copies the file from A's physical directory into B's directory. I'm sorta trying to forward reference the class.
Right click on project B, go to Add Reference..., go to the projects tab, select project A and add the reference. That should work. :)
I have also lived some years in Spain, and there people don't accept that you speak bad spanish. I usually compensate by speaking loud and accusing people of being stupid because they don't understand me. It usually works quite well. -jhaga on non-native languages
-
Right click on project B, go to Add Reference..., go to the projects tab, select project A and add the reference. That should work. :)
I have also lived some years in Spain, and there people don't accept that you speak bad spanish. I usually compensate by speaking loud and accusing people of being stupid because they don't understand me. It usually works quite well. -jhaga on non-native languages
-
Thanks, but Project A is not class lib (dll). Its an EXE that contains a class that I need to use in Project B.
albean wrote: Thanks, but Project A is not class lib (dll). Its an EXE that contains a class that I need to use in Project B. You either make it a .dll or include the file as a link. On the "Add Existing Item..." dialog, do you see the small arrow on the "Open" button? Click it and select "Link file". This way, you'll create a link on your project B to the class on the project A. This will have the side effect of including the code of the class on the project B, too, but I think that this is exactly what you're looking for, right? Acting as a substitute for God, he becomes a dispenser of justice. - Alexandre Dumas
-
Thanks, but Project A is not class lib (dll). Its an EXE that contains a class that I need to use in Project B.
Why not create a shared dll that resides between them. That's what I usually do if I need to create two apps that share some of the same basic functionality.
I have also lived some years in Spain, and there people don't accept that you speak bad spanish. I usually compensate by speaking loud and accusing people of being stupid because they don't understand me. It usually works quite well. -jhaga on non-native languages
-
Why not create a shared dll that resides between them. That's what I usually do if I need to create two apps that share some of the same basic functionality.
I have also lived some years in Spain, and there people don't accept that you speak bad spanish. I usually compensate by speaking loud and accusing people of being stupid because they don't understand me. It usually works quite well. -jhaga on non-native languages