Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dotfuscator "Could not find compatible version of ildasm"

Have any of you had this problem before?

I'm trying to obfuscate a solution written in C#/.NET 3.5 on Visual Studio 2008 SP1 on a machine running Windows 7 Professional SP1, and keep getting the same error when using Dotfuscator Community Edition

Could not find a compatible version of ildasm to run on assembly (valid path to solution output exe). This assembly was originally built with .NET Framework v2.0.50727

I've tried Googling and nothing much has helped so far (either that, or my Google-Fu is failing me).

I've tried re-installing the Windows SDK, and re-installing Visual Studio 2008, but neither have helped.

I'm assuming that it's Dotfuscator Community edition that's causing the problem, because a colleague is using the same xml settings file on his machine, and it obfuscates the solution no problem.

My idea is that, as it says in the error message, Dotfuscator cannot find an ildasm (the library/function used to obfuscate?) file that is compatible with .NET 3.5, only .NET 2.x. Is this a correct asusmption?

Dotfuscator had been working fine, previously. But, after a recent round of Windows updates it no longer seems to work on my machine - some of the recent Windows updates have caused havok with the network and some colleagues laptops (revoking login credentials, invalidating certain programs, the usual), that's why I'm assuming it's one of the updates that has caused this.

Of course, I'm not adverse to putting it down to user error, except for the fact that the same settings file and solution outputs are not causing Dotfuscator to fail on a colleague's machine.

Any suggestions?

like image 420
Jamie Taylor Avatar asked Jul 13 '12 11:07

Jamie Taylor


2 Answers

I had to add these four lines into my dotfuscator project file to resolve the problem:

<dotfuscator version="2.3">   
   <propertylist>
      <property name="ILDASM_v2.0.50727" value="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\ildasm.exe" />
      <property name="ILDASM_v4.0.30319" value="C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\ildasm.exe" />  
   </propertylist>

In general dotfuscator may miss any version of ildasm. It says what version is missing in error message. Just define propertiy with your specific version.

like image 138
Pashec Avatar answered Oct 15 '22 23:10

Pashec


As you've guessed, this is due to Dotfuscator failing to find the proper version of ildasm for the assembly provided to it. Dotfuscator obfuscation is performed via disassembling, altering, and reassembling the assembly, so it requires versions of ilasm/ildasm that match the assembly's target version.

Dotfuscator will search in \Windows\Microsoft.NET\Framework{FrameworkVersionHere} for the proper version of ilasm and ildasm, IIRC. Do you have those executables in \Windows\Microsoft.NET\Framework\v2.0.50727? If not, you'll need to get them in there - installing .NET framework 2.0 should do so (or just copy from a colleague's computer).

Edit to reflect comments below: We found that reinstalling the Windows SDK fixed the issue, likely because the Windows SDK's registry settings had been wiped out.

like image 20
ianschol Avatar answered Oct 16 '22 00:10

ianschol