26

How can I convert a completed C# project to a DLL, in order to use it in other projects?

I have Googled but lots of results say to open the Class Library, write your code there, then Build Solution and everything will be ok.

But my question is: how can I convert a completed project to a DLL? The project can include lots of Forms etc.

4

2 回答 2

26

if your code is complete, you need to create a Class project out of it, if you already have a project then only transfer the useful code to the class project for reuse in other projects

or change the Output Type to class library, you can find that in your project properties under the tab application

Output type

于 2012-07-18T07:18:45.663 回答
13

If you are using VS2010, go to your solution in Visual Studio,

  1. Click the 'Project' tab
  2. Select 'Project Properties' down at the bottom of the menu
  3. Now in the 'Properties' window click 'Application'. This should show you a menu
  4. On this menu, select the 'Output type' as 'Class Library'

Now when you compile the project you will get your output as a DLL (.dll) in the relevant bin folder.

I hope this helps.

于 2012-07-18T07:23:33.507 回答