Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
2.00/5 (4 votes)
See more:
In the c#.net .dll file is to creates with mainfunction possible or not?
In the c#.net .exe file is to creates without mainfunction possible or not?

What I have tried:

In the c#.net .dll file is to creates with mainfunction possible or not?
In the c#.net .exe file is to creates without mainfunction possible or not?
Posted
Updated 15-Feb-17 7:44am
Comments
Richard Deeming 15-Feb-17 12:45pm    
There is no such thing as "C#.NET" - it's simply called "C#".

The difference between a .NET EXE and a .NET DLL is simple: the EXE contains a main function and the DLL doesn't.
So no, you can't put a main in a DLL, or have an EXE without one.
In practice, you can rename an EXE to DLL and it will work just fine. But if you rename a DLL as an EXE it won't run: it doesn't have an entry point that the Windows execution system looks for to know where to start executing.
 
Share this answer
 
Quote:
In the c#.net .dll file is to creates with mainfunction possible or not?
Not
Quote:
In the c#.net .exe file is to creates without mainfunction possible or not?
Not
Short answer:
It is a DLL because there is no main function.
It is an EXE because there is a main function.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900