Question

I'm testing out Eziriz .NET Reactor to protect a software, developed using Visual Studio 2010 C# WPF.

I am confused when the .NET Reactor ask to which assembly to protect. I though it supposed to protect the .msi file where user will be installing. But it asks me to upload an assembly file which is an .exe. So I upload the .exe in my bin/Debug folder which is generated by building the solution in Visual Studio.

After running the protection on .NET Reactor, I open the same .exe file with .NET Reflector, and I can still see all the classes and methods. Nothing is being protected at all.

I have read through the documentation - is it just not working or am I doing something wrong?

Was it helpful?

Solution

Visual Studio usually rebuilds the entire project when making a setup. Hence your protected exe (that you generated .NET Reactor) will be overwritten by Visual Studio.

You should add a Post-build event (which is found in Visual studio Project properties) which calls .NET reactor to protect the DLL directly after it has been built.

Do note that the event should only run for release build, or you'll not bee able to debug your application. The problem is that you can't add a post build event for release mode only. The solution is to do a check like this: How to run Visual Studio post-build events for debug build only

OTHER TIPS

.NET Reactor can only protect your .NET assemblies (.exe, .dll) but not other files like setup.msi or setup.exe.

Depending on the kind of VS project (especially deployment/setup projects) protecting the assemblies via Post-build event could be too late.

In case you want to include a VS project file output (exe/dll) into you setup you could use the .NET Reactor Visual Studio Add-in the following way:

  • Open .NET Reactor and install the Visual Studio Add-in (.NET Reactor main menu item Help/Visual Studio -> Install Visual Studio 20xx Add-In).
  • Open your Visual Studio project and open the Add-in (Visual Studio main menu item Tools -> .NET Reactor).
  • Check "Enabled"
  • Check "Project Output Is Part Of A Deployment Project (Setup, ClickOnce)"
  • You can define the protection settings by defining the .NET Reactor project file or via command line switches
  • In case it is a ClickOnce project add '-invalid_metadata 0' as command line parameter (to prevent deployment problems)
  • Click OK and allow .NET Reactor to modify your Visual Studio project file

enter image description here

This way the Visual Studio project file is modified in a way to access .NET Reactor at the right time (after your assembly is compiled but still before it is added to the setup package).

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