Click here to Skip to main content
15,878,814 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
I have a project that is made on windows form and returns output (.exe) but i want it to return output file in (.dll).
The reason why i want it in dll file is because this software has some additional features which every user shouldn't posses.

Note:- i cannot change projects output type from windows application to console because later i need to run that file.

Please feel free to ask me if you have any query regarding this question.



Thanks in advance
Posted
Updated 9-Jun-15 3:41am
v2
Comments
[no name] 9-Jun-15 9:49am    
"Please feel free to ask me if you have any query regarding this question", okay so what is the problem exactly?
agent_kruger 9-Jun-15 10:14am    
problem is that i want to convert my exe file to dll file on building the project
[no name] 9-Jun-15 10:32am    
No that is not a problem at all. Why are you unable to change the project type or write a simple rename script in the build event? "I want" is not a description of any kind of a problem. And, what you want to do makes no sense anyway.
agent_kruger 10-Jun-15 9:30am    
I explain the whole situation. i have 2 project in a solution 1st is the main and core application which has all the calculations in it and second project has some piece of code that just corrupts the software (as per my requirement). so i made the second application as windows application too.So, at the time when i need to corrupt the software the other exe corrupts the main software and that is why i need the 2nd project exe to be hidden so that user doesn't crash the main software by mistake.
[no name] 11-Jun-15 7:31am    
And? That still doesn't make any sense at all. There probably no reason at all for you to do any of this. And making self destructing software is unethical IMO.

1 solution

Application type should be "class library".

Yes, I mean it. And then, in a library, you don't need entry point (static Main method). But if you leave it there, the library will still work: you can reference it in other application and then use the forms from your DLL. Technically, the only different feature if DLL is: it is not required to have this method.

You need to understand that in .NET there is no fundamental difference between .EXE and .DLL. The central concept is assembly, and PE files are modules. An assembly can have more than one module, but Visual Studio directly supports creation of only one per assembly. And then assemblies can reference each other. I can tell you more: even if you leave your .EXE as is, it can be referenced by some other assembly exactly as .EXE. There are even cases when doing so makes some practical sense, for example, simple plug-in architectures.

—SA
 
Share this answer
 
v2
Comments
agent_kruger 10-Jun-15 9:29am    
I explain the whole situation. i have 2 project in a solution 1st is the main and core application which has all the calculations in it and second project has some piece of code that just corrupts the software (as per my requirement). so i made the second application as windows application too.So, at the time when i need to corrupt the software the other exe corrupts the main software and that is why i need the 2nd project exe to be hidden so that user doesn't crash the main software by mistake.
Sergey Alexandrovich Kryukov 10-Jun-15 11:28am    
Sounds such an abuse! Anyway, gave you all the information you need; not draw your conclusions.
—SA

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



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