Hi, i've looked in several places for a how-to on C# DLL's.
I made a windows forms application, which beside regular files, has a pure .cs Class File.
I would like to extract a DLL from that file alone, how do i do that?
Ok here is how I like to do it (personal preference):
Here is how to do it from start to finish and keep it all organized for a project named "Daniweb":
- File -- New -- Project -- Windows Form App
- Check the checkbox for "Create directory for solution"
- Solution Name: "Daniweb"
- Project Name: "Daniweb.DesktopApp1"
Create the project
To add your DLL (while the project is open in VS):
- File -- New -- Project -- Class Library
- Toggle the combo box to "Add to Solution"
Repeat for all new projects
Then in your form application you want to right click on the "Reference" under the project in the solution explorer and select "add reference". Now you want to add a project reference to your class library, don't manually add a reference to the DLL. It gives you tighter debugging and building capabilities by using a project reference.
You might need to recreate your project or edit the .sln & .csproj to get the directory structure like I outlined but its worth it. I usually have
Proj.Core -- The "pure class" files: business entities, utils, etc
Proj.Web -- Web Interface
Proj.Desktop -- Desktop application
Proj.Data -- Data access layer
Proj.LK -- License key
Proj.Extensions -- Extension methods
#define A 3// name a constant
long int booking_ID ; ...