user472875
user472875

Reputation: 3175

Make a DLL out of a Windows Forms Project

I have a solution with 2 projects in it. One of the projects can only be run from the other. I want to convert it to DLL, so that end-users cannot directly run it (as it is, they get 2 executables). Is there any straightforward way to do this, without having to copy the entire project?

Upvotes: 7

Views: 11516

Answers (3)

Vercas
Vercas

Reputation: 9141

If you mean that you don't want the second executable to be run by the user (only by your program) then make a check in the program (that shouldn't be executed by the user) for an argument or something like that to match, to know that your main program started it.

Upvotes: 0

chezy525
chezy525

Reputation: 4174

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

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

Upvotes: 2

shf301
shf301

Reputation: 31394

Yes, go to the Project Properties, Application tab and change the Output Type.

Upvotes: 19

Related Questions