Allow embedding any assembly

.NET obfuscator and automated error reporting

Moderators: Luke Jefferson, melvyn.harbour, dom.smith

Allow embedding any assembly

Postby cbiggerstaff » Wed Nov 09, 2011 9:48 pm

SA doesn't always detect all the assemblies needed which basically forces me to use an installer on projects I wouldn't want to otherwise or include dlls along with exe versus having the single exe solution that I really appreciate SA can usually create.
In particular here's some dlls (needed) it doesn't detect (Devexpress suite and Entity Spaces):
DevExpress.XtraBars.v11.1.dll
DevExpress.XtraPrinting.v11.1.dll
DevExpress.XtraTreeList.v11.1.dll
EntitySpaces.DebuggerVisualizer.dll

To work around this (and added extra functionality) I'd love to see SA add option to browse for an assembly and add it to the embedded assembly list.
cbiggerstaff
 
Posts: 3
Joined: Thu Jan 11, 2007 9:50 am

Postby Brian Donahue » Fri Nov 11, 2011 10:47 am

Hello,

SmartAssembly has had numerous problems merging/embedding DevExpress components. Some are explicitly ignored by SA (for reasons that are completely undocumented) but sometimes it seems you can get the dependency recognized by creating an instance of the devexpress object somewhere in the code. For instance:
Code: Select all
var ps = new DevExpress.XtraPrinting.PrintingSystem();
ps.PageSettings.PaperKind = PaperKind.Letter;

That has been proven to work for XtraPrinting.dll. You can try instantiating some classes in one of the other DLLs and see if that works.
Brian Donahue
 
Posts: 6669
Joined: Mon Aug 23, 2004 10:48 am

Postby nkilian » Tue Feb 21, 2012 10:54 am

I'm having the same problem hee, but with Reactive Extensions: System.CoreEx and System.Reactive. Instantiating and using classes from either DLL in my main project doesn't help, SA still doesn't see them as dependencies. Is this something to do with the fact they they're in the System namespace?
nkilian
 
Posts: 11
Joined: Thu Dec 10, 2009 11:43 am
Location: South Africa

Postby Brian Donahue » Tue Feb 21, 2012 11:10 am

I have to say I honestly don't know - where can we get these "reactive" components or can you provide us with a sample application?
Brian Donahue
 
Posts: 6669
Joined: Mon Aug 23, 2004 10:48 am

Postby nkilian » Tue Feb 21, 2012 11:25 am

They're an MS Labs library all the cool guys are using: http://msdn.microsoft.com/en-us/data/gg577609

IObserver<T> and IObservable<T> are probably the most common uses, I specifically use IEvent<T> in this case.
nkilian
 
Posts: 11
Joined: Thu Dec 10, 2009 11:43 am
Location: South Africa

Postby Brian Donahue » Tue Feb 21, 2012 12:08 pm

The output of a .NET Console project referencing System.CoreX and System.Interactive can be successfully processed by SmartAssembly 6.6.

Maybe your dependencies have moved-have you tried setting MandatoryPath to the Reactive Extensions folder?
http://www.red-gate.com/supportcenter/C ... pendencies
Brian Donahue
 
Posts: 6669
Joined: Mon Aug 23, 2004 10:48 am

Re:

Postby nkilian » Tue Feb 21, 2012 12:17 pm

Brian Donahue wrote:The output of a .NET Console project referencing System.CoreX and System.Interactive can be successfully processed by SmartAssembly 6.6.

But can they be embedded or merged?
nkilian
 
Posts: 11
Joined: Thu Dec 10, 2009 11:43 am
Location: South Africa

Postby Brian Donahue » Tue Feb 21, 2012 12:25 pm

Sorry, yeah effectively SmartAssembly can mess up dependencies in two different ways, you can get an error that it can't find the assembly during the analysis, and then if that passes you may also just end up with the dependency missing from the list of assemblies you can merge or embed.

In the latter case, it's probably because the assemblies are signed with Microsoft's public key so it thinks they're part of the .NET Framework.

There is a secret registry key you can try setting, but I can't make any guarantee it will work or won't have any other ill effects: create a new DWORD HKEY_LOCAL_MACHINE\\SOFTWARE\\Red Gate\\SmartAssembly 6\\SupportsMergingFramework and set the value to 1

The other possible workaround is to ILDASM Microsoft's assembly and re-link and sign it using your own public key.
Brian Donahue
 
Posts: 6669
Joined: Mon Aug 23, 2004 10:48 am

Postby nkilian » Tue Feb 21, 2012 12:51 pm

Thanks. Tried the DWORD in both HKLM and HKCU with no luck even after a reboot. Will attempt the ILDSAM route next.
nkilian
 
Posts: 11
Joined: Thu Dec 10, 2009 11:43 am
Location: South Africa

Postby Brian Donahue » Wed Feb 22, 2012 1:25 pm

What is the version of SA you are using?
Brian Donahue
 
Posts: 6669
Joined: Mon Aug 23, 2004 10:48 am

Postby nkilian » Thu Feb 23, 2012 4:07 pm

Version 6.6.2.35
nkilian
 
Posts: 11
Joined: Thu Dec 10, 2009 11:43 am
Location: South Africa

Postby Brian Donahue » Thu Feb 23, 2012 5:25 pm

The old trick of reassembling the assembly doesn't seem to work. Maybe the problem is that all of the namespaces in the CoreEx DLL extend the System namespace. I tried turning on logging in SmartAssembly and it didn't print out any messages at all about this DLL, so I'll have to go through the SmartAssembly source code and see what the problem is.

But I'm pretty sure SA is just not liking the System namespace they use in that DLL.
Brian Donahue
 
Posts: 6669
Joined: Mon Aug 23, 2004 10:48 am

Postby nkilian » Mon Mar 05, 2012 4:15 pm

Thanks Brian, any idea when there'll be a viable workaround or built-in solution?
nkilian
 
Posts: 11
Joined: Thu Dec 10, 2009 11:43 am
Location: South Africa

Postby Brian Donahue » Mon Mar 05, 2012 4:46 pm

You can *try* adding the SupportsMergingFramework registry key, which is supposed to allow you to merge/embed System anmespaces but it didn't work in my reproduction.

HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Red Gate\\SmartAssembly 6\\SupportsMergingFramework should be a DWORD and have the value set to 1.
Brian Donahue
 
Posts: 6669
Joined: Mon Aug 23, 2004 10:48 am

Postby nkilian » Thu Mar 15, 2012 12:35 pm

Yup, tried that, no success either.
nkilian
 
Posts: 11
Joined: Thu Dec 10, 2009 11:43 am
Location: South Africa

Next

Return to SmartAssembly 6

Who is online

Users browsing this forum: No registered users and 0 guests