Smartassembly playing together with Dependency Injection

.NET obfuscator and automated error reporting

Smartassembly playing together with Dependency Injection

Postby kimpenhaus » Tue May 10, 2011 1:40 pm

Hi there,

we have several services which need to be obfuscated (name-wrangling as well as control-flow obfuscation as well as other features like embedding, pruning etc but not as necessary as first two points).

The problem we are facing is that we have some assemblies loosely coupled and no direct reference between the assemblies. While we are not able to set references inside smartassembly by hand - what can we do to set those references so that we could embed our assemblies? Or are there different ways to obfuscate more than 1 main assembly inside of smartassembly?

I am aware of the fact, that it sounds a bit controversial having dependencies which are loosely coupled embedded into assemblies. This is mainly because we face different provider for different customer and different production environments.

Thanks in advance,
kind regards,

Posts: 11
Joined: Sun Feb 13, 2011 3:50 pm
Location: Germany

Postby ShortAngry » Tue May 10, 2011 3:06 pm

From what I understand, SA will automatically pick up on directly referenced assemblies but it sounds like in this instance you may have to create separate projects for each of the loosely coupled assemblies.

I would start with all the SA options turned off and slowly turn features on one by one until you either get the protection you want or hit a specific problem. If you do hit a specific problem you can usually work around it by using custom attributes as detailed here: ... .0/toc.htm

If you find you're unable to do this, you might want to contact support @ directly.
Posts: 13
Joined: Thu Dec 02, 2010 11:29 am

Postby nkilian » Sun May 22, 2011 9:06 am

I'm encountering a similar problem.

We access some assemblies in our application only through reflection, and even though we have a project reference to the assembly in Visual Studio (and TFS builds this reference for us and deploys it to the drop folder), SA doesn't identify it as a dependency.

As a workaround, somewhere in the executing assembly we force a dependency by declaring a variable as a type in the target assembly.

But it would be great if SA would allow us to include these unused references as dependencies so we can embed and optionally obfuscate and prune them.
Posts: 11
Joined: Thu Dec 10, 2009 10:43 am
Location: South Africa

Postby kimpenhaus » Sun May 22, 2011 9:46 am

We went away from using Ninject.Xml Extension and are using now small binding modules. This is of course more secure (and fits {sa} needs while depenedencies are now linked in) but at cost of flexibility.
This is in case of that our production system, q&a system and development system use different adapter for binding against an archive system - so we need do deploy different builds to different systems, which is meant to make murphy will say.
Posts: 11
Joined: Sun Feb 13, 2011 3:50 pm
Location: Germany

Return to SmartAssembly 6

Who is online

Users browsing this forum: No registered users and 1 guest