Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c#

c++-cli

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 :)

like image 488
George Johnston Avatar asked Oct 14 '22 10:10

George Johnston


1 Answers

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.

like image 146
CesarGon Avatar answered Oct 30 '22 02:10

CesarGon