Home - Forums-.NET - Spices.Net - MSBuild+VSIP+ClickOnce problem

Spices.Net

NET code security, tools to protect, obfuscate, tamper defense, code and data safety, recover, convert, optimize, explore, browse and analyze .Net software.

This forum related to following products: Spices.Net Suite, Spices.Net Obfuscator, Spices.Net Decompiler

MSBuild+VSIP+ClickOnce problem
Link Posted: 12-Nov-2010 12:18
I have completed nearly all of the steps but the deployed exe is not obfuscated. I am sure it is a simple setting that I am missing. Could you help me with it please?

I have created a VS2005 project called ClickOnce_HelloWorld. I followed the explanation in the help file for ClickOnce deployment completing the following steps:

1. I registered the tasks provided by NineRays.Build.Tasks.dll by placing the following line at the end of the Microsoft.Common.Tasks file:
<UsingTask TaskName="Obfuscator" AssemblyFile="C:\Program Files\9Rays.Net\Spices5\Bin\NineRays.Build.Tasks.dll"/>

2. I set the MSBuild task in the VS2005 project file by adding the following code at the end. of the project file...
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <UsingTask TaskName="Obfuscator" AssemblyFile="C:\Program Files\9Rays.Net\SpicesNet5\Bin\NineRays.Build.Tasks.dll"/>
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterCompile">
        <Obfuscator
          InputFiles="$(IntermediateOutputPath)$(TargetFileName)"
          Options_Members="KeepsInheritance"
          Options_Naming="NonDisplayable"
          Options_Anonymizer="Minimum"
          Options_MixDictionary="true"
          Options_StringEncryptionMode="Encrypt3DES"
          Options_antiILDASM="True"
          OutputPath="$(IntermediateOutputPath)"
          SearchPaths="C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\"
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->

3. Included a Spices.NET project where I have set the output directory and other settings. (this is where I am missing something, I think!)
4. I have built the VS 2005 project and published it to wwwroot\ClickOnce_HelloWorld.

My problem is that when I check the published exe, it is not obfuscated.
Could you please look over the project to see what settings I am missing?
Link Posted: 12-Nov-2010 12:29
There are two incorrectnesses in this sample:
1. Seems all this code is commented by xml-comment tag (<!--...-->) and text inside of these tags can't be used to run.
2. Missing closing tag in the Obfuscator task.
The correct code looks like:
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
     Other similar extension points exist, see Microsoft.Common.targets.
-->
<UsingTask TaskName="Obfuscator" AssemblyFile="C:\Program Files\9Rays.Net\SpicesNet5\Bin\NineRays.Build.Tasks.dll"/>
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterCompile">
        <Obfuscator
          InputFiles="$(IntermediateOutputPath)$(TargetFileName)"
          Options_Members="KeepsInheritance"
          Options_Naming="NonDisplayable"
          Options_Anonymizer="Minimum"
          Options_MixDictionary="true"
          Options_StringEncryptionMode="Encrypt3DES"
          Options_antiILDASM="True"
          OutputPath="$(IntermediateOutputPath)"
          SearchPaths="C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\"/>
</Target>
<Target Name="AfterBuild">
</Target>