c# - Multiple exe files in one solution, all referencing a single public class -
i have c# console project (vs2012) getting big. calling multiple 'methods' 1 after other. add more methods able break them out multiple executable files, ran scheduled apps, still able reference (and change using tortoise svn) public class of rules of reference. have create dll accomplish or there simpler way? sorry, i'm new of this. have found similar questions either did not understand them or weren't quite looking for. thanks!
yes need build dll , reference whatever project needs code stored there.
matter add new library project solution, create public class , insert methods should called other projects
click menu file , choose add project
then go solution explorer window, click console application , right click on references
and select solution folder project of class library
now go predefined class1 , add following code
namespace consoleapplication1 { // class contains methods , data used/shared various applications public class class1 { public class1() { } public void show(string message) { console.writeline(message); } } }
and in consoleapplication1 add following code
namespace consoleapplication1 { class program { // sample console application uses library project.... static void main(string[] args) { class1 c=new class1(); c.show("hello world"); } } }
Comments
Post a Comment