I am trying to learn to write my codes in libraries and compile them into DLLs in C#.
This is what I do:
I have a main VS project in which I piece up the different parts of the application that I am writing.
I write my classes in separate VS projects. Then, I compile them into DLLs, which I will copy the DLLs to the main VS project. The main VS project will make references to these DLLs and then use them in its logic.
The problem, however, is that when there is a bug or issues with the codes compiled in the DLL, it becomes very difficult to debug. The compiler won’t tell where exactly the error came from. Also, when I make changes to the classes resided in the DLLs, I have to always recompile and replace them when working on the main VS project.
My workflow becomes very obtrusive this way. What should the correct workflow be when working with DLLs?
Add the DLL project(s) to the solution file which contains the main project and you will be able to break into that code with the debugger (right click solution -> add existing project).