4

I have a C# 2010 WinForms application using .Net Framework 4.

I am using Eazfuscator.NET to obfuscate this application. If I obfuscate the executable manually, everything works fine.

When I try to make the program obfuscate itself on every build by dragging the project onto the green part, everything works fine and this is output:

Protecting project 'Roster Manager.csproj'... done

Protected project will be obfuscated automatically during the build in Release configuration
Please restart Visual Studio to complete the installation of Eazfuscator.NET

After that, I close VS, start it again, clean the solution, rebuild it and run it. The program works but it is not obfuscated, as proved by decompiling it using Reflector 7.

I am building it in Release as requested by the program.

Searching the web didn't help so maybe if someone ran into this problem before might have a fix to this issue.

Community
  • 1
  • 1
Vlad Schnakovszki
  • 8,434
  • 6
  • 80
  • 114

3 Answers3

3

Eazfuscator add this line to the PostBuildEvent (Word Wrapped for legibility, but it is one line) of your project. (Right click on Project -> Properties -> Build Events.)

if /I "$(ConfigurationName)" == "Release" Eazfuscator.NET.exe "$(TargetPath)" 
--msbuild-project-path "$(ProjectPath)" --msbuild-project-configuration "$(ConfigurationName)" 
--msbuild-project-platform "$(PlatformName)" --msbuild-solution-path 
"$(SolutionPath)" -n --newline-flush -v 3.2

Check if it is present and if your release configuration is really called "Release".

Steve
  • 213,761
  • 22
  • 232
  • 286
  • The PostBuildEvent is present and the configuration is 100% "Release". – Vlad Schnakovszki Jun 02 '12 at 19:21
  • If you open a command prompt and type Eazfuscator.Net.exe you get a file not found error? (PATH missing) – Steve Jun 02 '12 at 19:33
  • Nope, I get this: Eazfuscator.NET Version 3.3 (Release build 3.3.152.33186) Copyright (C) 2007-2012 Oleksiy Gapotchenko Protect your precious Intellectual Property reliably with ease! Usage: Eazfuscator.NET.exe [options] [input file 2] ... Generic options: -? [ --help ] Produce detailed help message. --version Print version string. -n [ --nologo ] Suppress logo message. – Vlad Schnakovszki Jun 02 '12 at 19:39
  • Last try, could you check if in your Build -> Configuration Manager the project is selected to compile in release mode? – Steve Jun 02 '12 at 19:41
  • Yes, the configuration is set to Release. – Vlad Schnakovszki Jun 02 '12 at 19:46
  • A new idea, try to set the output verbosity of the compilation to maximum level. Perhaps this will give you an idea why the build manager doesn't execute the PostBuildEvent. (Tools->Options->Project and Solutions->Build And Execute) – Steve Jun 02 '12 at 19:59
  • I have set it to Diagnostic and then Detailed but nothing changes. I am pretty sure it executes it because it used to pop an error saying something about the PBE when rebuilding. The solution online was to restart VS and it worked and I didn't see that error since. Any other ideas? – Vlad Schnakovszki Jun 02 '12 at 20:12
  • 1
    Just tried to uninstall ver 3.2 and installed 3.3. Works with no problems. – Steve Jun 02 '12 at 20:19
  • I created a new program and ran it with automatic obfuscation and it still didn't work so it was clearly the OS's fault then. Then I've realised that the User Account Control usually causes problems like this. Disabling it made the obfuscator work like a charm. Thanks for helping! – Vlad Schnakovszki Jun 02 '12 at 21:31
3

Finally managed to fix it. Seems that disabling the User Account Control resolves the issue.

A quick Google search will give more details into how to do this.

Vlad Schnakovszki
  • 8,434
  • 6
  • 80
  • 114
0

If you're using a version control system like TFS, .csproj file may be locked. So you'll have to unlock file by checking it out or unchecking "Read-only" box from file properties.

Kubilay Kara
  • 318
  • 2
  • 9