user472875
user472875

Reputation: 3175

Making a C# project DLL and EXE

I'm working on a project where I need to have both an executable so that the user can run a configuration interface and a DLL that can be embedded in other projects to use some of the other features. Is there a way to make Visual Studio produce both an executable and a DLL (as opposed to switching it manually every time)?

Upvotes: 5

Views: 3537

Answers (2)

Darkhydro
Darkhydro

Reputation: 2072

I agree with TJMonk15, but i think this should be explained explicitly. You should have two projects, one project that is a DLL, and one that is a normal project. The DLL project should have all your re-usable code. The normal project should be the application you are building, which will reference your re-usable DLL. This way you can build a framework in the DLL project that can be used for any of your future projects.

A good example of this is when you are making a game. Your game engine would be the DLL, and the game you are making would be the executable project. The executable project will contain all the non-reusable traits such as game GUIs and content.

Upvotes: 4

FallenAvatar
FallenAvatar

Reputation: 4079

Why wouldn't you put most of the code in one project (With an ouput of type Library) and then write an executable that referenes the DLL?

Upvotes: 2

Related Questions