Click here to Skip to main content
15,942,934 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Dear Friends,

I made a dll but it was opened in another software. i want that the dll cannot be opened from any software.


No, you can't. Because .NET assembly is MSIL. It can be de-comiled.
Please check obfuscation tools.
Obuscators for .NET
Share this answer
You cannot prevent decompilation as such since every dll has to be a valid assembly as per the CLI specification. The typical approach is to use an obfuscator on the binaries before releasing them. Again, this will not prevent decompilation but the decompiled code will be much harder to understand. The Community Edition of PreEmptive Dotfuscator has has shipped with Visual Studio[^] for a few releases so I suggest you start there.
Share this answer
Don't exactly what you mean by "open in another software", but I'll assume you mean you can decompile .NET assemblies and see the actual source code.

For that there is obfuscation. By obfuscating your sources, people will still be able to decompile the assembly, but it'll be a lot harder to understand the code (though not impossible). There are a couple of tools available, both free and paid.

Eazfuscator.NET[^] (free)
Dotfuscator[^] (community edition is free, see more info on that at Microsoft[^])
SharpObfuscator[^] (free)
Confuser[^] (free)
And a few others[^]

You'll also want to make sure you sign your applications with a code signing certificate (not free). This will ensure to your users that the assembly originates from you (or rather your company) and hasn't been tampered with.

If you mean to prevent the use of your assembly in other applications, you can do the following:
How can I prevent unauthorized code from accessing my assembly in .NET 2.0?[^]

You'll need to be sure to sign your assemblies and executables with a Strong Name Key.
Share this answer

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