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?
Thanks,
PM
Yes, go to the Project Properties, Application tab and change the Output Type.
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>
...
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.