How to access methods from other project in solution?
-
Hello I have such question(may be its simple,but i couldnt resolve it myself:( ): i have solution with 2 projects.In the second one i need to access some methods from the first and for that i do the following: add the reference in the second project to a project dll from the first one.Then,when i need to use methods i call using namespace_from_first_proj; namespace Second_proj_namespace { public class SecondProjClass { FirstProjClass.Method();// want to use static method from first project(class FirstProjClass is from namespace_from_first_proj namespace),but VS doesnt let me to do that :( } } So..The the class from the second project SEES class from first,but doesnt see its methods:(..why?
-
Hello I have such question(may be its simple,but i couldnt resolve it myself:( ): i have solution with 2 projects.In the second one i need to access some methods from the first and for that i do the following: add the reference in the second project to a project dll from the first one.Then,when i need to use methods i call using namespace_from_first_proj; namespace Second_proj_namespace { public class SecondProjClass { FirstProjClass.Method();// want to use static method from first project(class FirstProjClass is from namespace_from_first_proj namespace),but VS doesnt let me to do that :( } } So..The the class from the second project SEES class from first,but doesnt see its methods:(..why?
Have you used "public static.." modifiers in this method declaration?
Visit my blog at http://dotnetforeveryone.blogspot.com
-
Have you used "public static.." modifiers in this method declaration?
Visit my blog at http://dotnetforeveryone.blogspot.com
-
How have you added the reference? Adding a dll reference(on tab dll reference) or a project reference(on Other projects reference)?
Visit my blog at http://dotnetforeveryone.blogspot.com
-
How have you added the reference? Adding a dll reference(on tab dll reference) or a project reference(on Other projects reference)?
Visit my blog at http://dotnetforeveryone.blogspot.com
F.Y.I... In VS2017 there is something called Shared Projects and a Reference Manager... where a common piece of code can be used in multiple projects. ETA: It appears that these: Reference Manager / Shared Projects are two different things, which work similarly. I'm still researching how this all works, but it sounds promising... ref1: How to: Add or remove references by using the Reference Manager Add references in the Reference Manager - Visual Studio | Microsoft Docs[^] ref2: Shared Projects code sharing Use Shared Projects to Share Code - Xamarin | Microsoft Docs[^]
Take Care God Bless... Feedscrn +------------------------------+ | The screen is hungry, Feed It! | +------------------------------+