(C#/C++ CLI) Is it possible to protect my C++ CLI assemblies from being used in other .NET projects?

c#, c++-cli

Solution

I have used this technique with success.

Basically, it's about protecting your assembly from being loaded by placing a link-time security demand and using the assembly strong name's public key as evidence. Only assemblies signed with your private key will be able to load it.

Problem

I have created a C++ CLI wrapper for native C++ code, which in turn I reference in my C# application. Is it possible to somehow protect this assembly so that it may only be used in my application without the possibility of someone else using it? I'm a Microsoft technology developer, I'm all about selfishness :)

Original source

Related problems