C # make a DLL from a Windows Forms project

I have a solution with two projects. One of the projects can only be launched from another. I want to convert it to a DLL so that end users cannot run it directly (as it is, they get 2 executable files). Is there an easy way to do this without having to copy the entire project?

Thanks,

PM

+7
c # dll
source share
3 answers

Yes, go to the tab "Project Properties", "Application" and change the type of output.

+17
source share

If you prefer to play with .csproj xml, you want to change the OutputType from WinExe (or Exe ) to Library , it should be found at the top of the file:

 <Project ...> <PropertyGroup> <ProjectGUID>{YOURGUID-ABCD-0123-4567-0123456789AB}</ProjectGuid> <OutputType>Library</OutputType> ... 
+2
source share

If you mean that you do not want the second executable to be executed by the user (only by your program), do a check in the program (which should not be executed by the user) for an argument or something else to match, to know that your main the program launched it.

0
source share

All Articles