Question

I am using VS2012, Visual Basic and wish to create a Class Library.

Is it possible to restrict access to a Class Library? I am wanting to create a Class Library for the serializing of objects. This Class Library will be included in each of my applications. As such, is it possible to ensure that only my applications can use this Class Library? If so, how do I go about this?

Was it helpful?

Solution

You can make it more difficult but not entirely prevent your library being used in another application.

You can do things like obfuscate the code to make it harder to decompile, and add dummy parameters to the public methods so that it's hard to figure out how to call them.

If someone is really determined, they will find away around whatever technical measures you use. How much effort you should spend on protection, and how much effort anyone would use to get access depends on how valuable the code in the class library is.

If it is really important that no-one can use your class library, set it up as a web service, so you don't have to distribute it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top