I've got an C# Project in Visual Studio, which has Console Application
as Output Type.
But I also need a Class Library
of this project for another solution.
Right now I have to switch the output type every time, but I wonder if it's possible to generate exe
and dll
at the same build-event
?
Is there a post-build-event
for this?
Solution 1Add a reference to the DLL directly to your new project: open your project in VS, expand the Project branch in the Solution explorer, then right click "References". From the context menu, select "Add Reference..." and wait for the dialog - If can take a little while to appear.
Open Visual Studio, and choose Create a new project in the Start window. In the Create a new project window, select All languages, and then choose C# from the dropdown list. Choose Windows from the All platforms list, and choose Console from the All project types list.
To create a DLL project in Visual Studio 2019On the menu bar, choose File > New > Project to open the Create a New Project dialog box. At the top of the dialog, set Language to C++, set Platform to Windows, and set Project type to Library.
To my knowledge there is no possibility to change the output type after compilation. That being said, if would be possible to have two projects like Console and Library in your solution, which would use the same source code files but have different output types. That way you would have different outputs without any duplication of code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With