Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How actually .dll file work?

Status
Not open for further replies.

whloo

Programmer
Apr 14, 2003
168
SG
Hi,

I always see those control created by many programmer and it is in .dll file.
how is it actually work and how do i compile all of my work to .dll file so that other peoples can't see my code when i deploy it to their server.
Thanks!

Regards,
weihann.
 
DLLS started because the early versions of Windows were very memory constrained (remember when 8mb RAM was a lot?) and they were a way to share code between different modules of an application. Because they're code-only, they only get loaded into memory once -- all applications that use one are sharing the same memory image. This is also why you can't define global variables in a DLL (memory for shared variables has to come from the calling EXE file). (NOTE: COM DLLs are a different story - we're talking Win16 and Win32 here).

Under .NET, the same rules apply -- Assemblies which are DLLs are shared between Assemblies which are EXEs, or run in an EXE (like ASP.NET pages).

To create a DLL in .NET, you just create a project of type Class Library. You will need to also create a small EXE project to unit-test your DLL, since a DLL can't be called directly in the debugger.

Preventing other people from seeing your code is very difficult in .NET, as anyone can run ILDasm.exe against an assembly and inspect it's contents. There are some obfuscators available now (do a Google search), but I think they're more trouble than they're worth -- You should be able to depend on your products license, which should not permit reverse-engineering. In the future, you will be able to apply Digital Rights Management (DRM) to your assemblies to prevent people from viewing them.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
chiph,

thanks for the reply.
but i still don't understand how to compile my current project into a .dll file.
i have aspx and class file in this project.
is there any web sites that will teach me step by step to create .dll file.
thanks!

regards,
weihann.
 
hi guys/gals,

i manage to do it already!
thank you very much esp chiph!
 
Can you post the link to the web site where you found the answer to your problem?

thanx
 
al1975,

basically i just follow chiph intruction. :)
 
al1975 -

It's pretty easy - click New Project, then select C# projects, then select Class Library.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top