Click here to Skip to main content
15,888,011 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have c# code that initializes a force feedback joystick and plays force effect file. I want to change this c# console application into a dll file so that I can use it in labview. http://stackoverflow.com/questions/24839498/converting-a-c-sharp-console-app-to-a-dll[^]

What I understood from this post is that I just need to create a class library and copy paste my codes there, is this true? I did get a dll file by just doing that. If I'm wrong can you explain how to convert a console application to a dll?
Posted

Yes, basically.
Create a Class Library project, and it will create a DLL file instead of an EXE.

And if you paste your code into the new project (changing the namespace appropriately, obviously) then the DLL will continuation your code. Except for the Main method, which DLL files don't have as they are not directly executable.
 
Share this answer
 
Comments
Bangsang 9-Mar-15 4:38am    
Would just changing the output type from console application to class library work also?
It is true.Your class library is converted to dll which you can use in other projects.
 
Share this answer
 
Yes, you can.

Build a new project and choose Class Library, then simply put all you code into a public class and use it as any other library.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900