Is there any way to change my class library program into an .exe
or a click once-application? It is Currently a dll.
I am able to create a click once app but it is not working after installation.
In the Solutions Explorer window, right-click the exe project and then select Properties in the popup. Then change the Output type from Windows Application to Class Library.
The Class Library . DLL contains program code, data, and resources that can be can used by other programs and are easily implemented into other Visual Studio projects.
Solution. Right click on the Solution Explorer of your project in the right top corner of the IDE and the select the Properties option located in the dropdown menu. Now from the Solution Property Pages dialog that appears, select the StartUp Project list option.
In the properties of the project -> application tag, change the Output type to console Application. Anyway, you need to create a static Main()
method as a starting point.
static void Main(string[] args) { }
You can change the output type of your project in it's settings, then add a main entrypoint, as others have mentioned (Note, you want "Windows application", not "Console Application" here):
If you can't change the source for some reason, you can create a new very simple application (an .exe), and call public methods in your .dll from it:
namespace YourNamespace { internal class YourApp { private static void Main(string[] args) { // Call your function here. } } }
To do this, you just need to include a reference to the existing .dll into this new application.
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