i create a project ClassLibrary1,contain a method Class1.Get1();
then create a project ClassLibrary2,contain a method Class2.Get2(),and reference ClassLibrary1.dll
then create a project ConsoleApplication1,and reference ClassLibrary2.dll,
i just can call Class2.Get2() from ConsoleApplication1.Program,but
how can i call Class1.Get1() but don’t reference ClassLibrary1.dll
thanks
i create a project ClassLibrary1 ,contain a method Class1.Get1(); then create a project ClassLibrary2
Share
You have to reference
ClassLibrary1fromConsoleApplication1in order to be able to use it there. You can’t use an assembly (ClassLibrary1) referenced in another assembly (ClassLibrary2).To answer your question about calling
Class1.Get1()without referencingClassLibrary1.dll, the easiest thing to do is probably just wrapClass1.Get1()in a method inClassLibrary2somewhere.