I guess I need to create an Assembly but how do I do this concretely when I have multiple classes ? There seems to be many steps involved and searching on the net I cannot find any article on this subject. Can anyone point me to one if it exists ?
Create a new project of type "Class Library", and put you business layer classes in it. Then reference it from your web app and your desktop app.
You have to create a new project of Class Library type, and put you shared classes there. When you compile such type of project, you get a dll file in the output folder (the output folder, if you didn't change the default, is bin\debug or bin\release, relative to your project folder)
Than, you have to reference this dll from your web app and and your desktop app.
However, if you're using Visual Studio, another option is to use the "project reference" feature. If you put all your 3 projects in the same solution, you can tell your web app and and your desktop app to reference the class library project, not directly the dll. If you reerence this way, VS take care of recompile your business dll whenever it is needed. With the first option you have to remember to manually recompile the business project whenever you edit it, otherwise your UI project still reference the old version of the dll .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With