Can someone tell me what the best approach to protecting my component DLLs in .Net?
I've written a few DLL components which will be publicly available. They will be licensed accordingly but I want to programmatically make sure that no one is using the components within their solutions illegally.
Any ideas?
Since your code is already obfuscated, you can enforce the inbuilt classes to be instantiated with a license key before any of the methods are called. If you find that the key is not valid/present you can either display a message box or return an error/exception. There are many examples of where this is done (checkout Xceed.com for one) but as the previous posts suggest, its simply for discouraging the end users from trying to use your assembly illegally. Not completely prevent it. Given sufficient time and incentive, any thing can be broken.