. Net EXE files can be referenced directly when DLL files
Source: Internet
Author: User
. Net EXE files can be referenced directly when DLL files
I found an interesting thing today. My colleague asked me if some data in an EXE file can be directly loaded and used by reference. I think it should be okay to use reflection. But I know that. Net's ProgramThere are multiple carrier forms in the collection. EXE is one of them. That is to say, EXE is actually an assembly, but it only carries a startup module (a traditional PE file module for startup. net CRL, and then return to the application entry to execute the program ).
If you skip this startup module, it is easy to think that this EXE file is no different from a DLL file. In fact, we can not modify any CodeDirectly compile an EXE project into a DLL file.
We did a bold test to change the extension of the EXE file to DLL and then let vs directly reference it. We did not expect it to succeed directly. Later, I compared the output of different EXE files and DLL files with IDE, and found that the two files are identical. That is to say, IDE output only modifies an extension. Funny, but this is also a good thing.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.