Licensing and .NET obfuscation/code protection

In order to prevent the use tools like .NET Reflector to expose the code of our application, we use a tool called .NET Reactor to hide the code from reflection.

This tool can protect .NET code beyond obfuscation.



Unfortunately, this breaks the GO licensing when we deploy our application.



Any suggestions on how to use GO licensing with code protection tools like .NET Reactor ?



We are using VS 2008.

We aren’t familiar with .NET Reactor.

Did you apply that tool to the Northwoods.* assemblies? (I’m expecting not.)

Does the licensing work as expected if you don’t use the .NET Reactor tool?

Have you tried using that tool on all of your assemblies except the .EXE?

We did not apply it to the Northwoods assemblies.



GO licensing does work without .NET Reactor.



The code we have to protect currently is in the .exe, but ideally we would want to protect all the code.



How do we have to break up the code in assemblies to get the licensing working ?



Is the licensing limited to the .exe or will any reference to GO in an assembly require it to be unprotected ?

Well, I’m just speculating, but I’m wondering if .NET Reactor has somehow messed up the license key that is stored in the EXE. That’s the license key that is generated by the Microsoft License Compiler (LC.EXE) and the licensed component when LC compiles the LICENSES.LICX file.

One way to find out is to put all of your code into a DLL that is used by your EXE. The EXE would just contain your Program class and the LICENSES.LICX file (and references to your DLL and to Northwoods.Go.DLL); everything else could go into the DLL. You would not use .NET Reactor on the EXE, but you would on your DLL.

Putting our code into a .NET Reactor protected dll and building a shim application with the licenses.licx file does work. As you implied, we can’t include the Northwoods libraries in the protected dll without breaking the licensing (but that’s alright).

Hmmm, that implies that .NET Reactor might break any component that uses the Microsoft licensing architecture in .NET, not just GoDiagram.

We’re not too worried about obfuscating our assemblies, because leaving our code decompilable makes it easier to debug and understand. We also license our source code for those who want to read it (more intelligibly, with comments).

Thanks, it works now.



We created a shim executable that has the license file and is unprotected.

All it does is launch the MainForm, which is in a dll with all the other code, and it is protected.









[QUOTE=walter]Hmmm, that implies that .NET Reactor might break any component that uses the Microsoft licensing architecture in .NET, not just GoDiagram.
[/quote]

It’s interesting that you say that because GoDiagram insists that the .licenses resource be in the executable and not a DLL referenced by the executable, which the .NET licensing framework DOES support. In that light, do you know of an alternate way that I could pass the license key into GoDiagram?

Since I haven’t tried using .NET Reactor, I can’t say this for sure, but I would guess that putting the license key in the DLL would suffer the same problem as having it in the EXE.

I’m not referring specifically to .Net Reactor, just to the fact that GoDiagram adds the extra requirement that the license key needs to be compiled into the .EXE, and will break if inside the .DLL.