BUG using the SmartAssembly command line

Mike74Mike74 Posts: 2 New member
edited October 25, 2013 1:43PM in SmartAssembly
Hi all,

I have a problem using the command line, and it seems to be a bug (or a misunderstood !!), let me explain with a simple example ...

I have an assembly called My.Assembly.To.Protect

The several assemblies are :
My.OpenAssembly
OpenAssembly

I run the following command line :
SmartAssembly.com /create "My.Assembly.To.Protect.saproj" /input="D:\Release\My.Assembly.To.Protect.dll" /output="D:\NewRelease\My.Assembly.To.Protect.dll /assembly="My.Assembly.To.Protect ";prune:true,merge:true,embed:true,nameobfuscate:true,controlflowobfuscate:4,dynamicproxy:false,compressencryptresources:false


The result of the command is :
SmartAssembly v6.8.0.121
Copyright © Red Gate Software 2005-2013
Loading project D:\My.Assembly.To.Protect.saproj
  Input=D:\Release\My.Assembly.To.Protect.dll
  Output=D:\NewRelease\My.Assembly.To.Protect.dll
Loading main assembly...

Assembly "My.Assembly.To.Protect": Pruning on
Assembly "My.Assembly.To.Protect": Name Mangling on
Assembly "My.Assembly.To.Protect": Control Obfuscation set to level 4
Assembly "My.Assembly.To.Protect": Dynamic References Proxy off
Assembly "My.Assembly.To.Protect": Resource Compression off
The assembly name 'My.Assembly.To.Protect' is not valid for embedding.
The following assemblies are valid with the '/assembly' switch:
My.Assembly.To.Protect
My.OpenAssembly
OpenAssembly

ERROR: At least one of the specified assembly names is not valid.

If I chose another dependency for the option /assembly (My.OpenAssembly or OpenAssembly), it works correctly. I have no trouble like that using the SmartAssembly GUI.

I use https://www.red-gate.com/supportcenter/ ... ommandLine documentation to create the comman line.

Hope you can help me !

Regards,

Mike

Comments

  • Jessica RJessica R Posts: 1,319 Rose Gold 4
    Hi Mike,

    It looks like the command line is saying that the main assembly "My.Assembly.To.Protect" can be embedded, but the embed switch will actually only work on dependencies of the main assembly.

    So sorry about this misleading error. I've logged an issue for it with internal reference SA-1760 --thanks for bringing it to our attention!

    If you remove the embed:true for the main assembly and instead add it to the assembly options for the particular dependencies My.OpenAssembly or OpenAssembly that you'd like to embed, that should resolve it! But please let us know if there are any further issues.

    Jessica Ramos | Product Support Engineer | Redgate Software

    Have you visited our Help Center?


Sign In or Register to comment.