Red Gate forums :: View topic - Allow embedding any assembly
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SmartAssembly 6
SmartAssembly 6 forum

Allow embedding any assembly

Search in SmartAssembly 6 forum
Post new topic   Reply to topic
Jump to:  
Go to page 1, 2  Next
Author Message
cbiggerstaff



Joined: 11 Jan 2007
Posts: 3

PostPosted: Wed Nov 09, 2011 9:48 pm    Post subject: Allow embedding any assembly Reply with quote

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.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6677

PostPosted: Fri Nov 11, 2011 10:47 am    Post subject: Reply with quote

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:
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.
Back to top
View user's profile Send private message
nkilian



Joined: 10 Dec 2009
Posts: 11
Location: South Africa

PostPosted: Tue Feb 21, 2012 10:54 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Brian Donahue



Joined: 23 Aug 2004
Posts: 6677

PostPosted: Tue Feb 21, 2012 11:10 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
nkilian



Joined: 10 Dec 2009
Posts: 11
Location: South Africa

PostPosted: Tue Feb 21, 2012 11:25 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Brian Donahue



Joined: 23 Aug 2004
Posts: 6677

PostPosted: Tue Feb 21, 2012 12:08 pm    Post subject: Reply with quote

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/Content/SmartAssembly/help/6.6/SA_SearchingForDependencies
Back to top
View user's profile Send private message
nkilian



Joined: 10 Dec 2009
Posts: 11
Location: South Africa

PostPosted: Tue Feb 21, 2012 12:17 pm    Post subject: Re: Reply with quote

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?
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Brian Donahue



Joined: 23 Aug 2004
Posts: 6677

PostPosted: Tue Feb 21, 2012 12:25 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
nkilian



Joined: 10 Dec 2009
Posts: 11
Location: South Africa

PostPosted: Tue Feb 21, 2012 12:51 pm    Post subject: Reply with quote

Thanks. Tried the DWORD in both HKLM and HKCU with no luck even after a reboot. Will attempt the ILDSAM route next.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Brian Donahue



Joined: 23 Aug 2004
Posts: 6677

PostPosted: Wed Feb 22, 2012 1:25 pm    Post subject: Reply with quote

What is the version of SA you are using?
Back to top
View user's profile Send private message
nkilian



Joined: 10 Dec 2009
Posts: 11
Location: South Africa

PostPosted: Thu Feb 23, 2012 4:07 pm    Post subject: Reply with quote

Version 6.6.2.35
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Brian Donahue



Joined: 23 Aug 2004
Posts: 6677

PostPosted: Thu Feb 23, 2012 5:25 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
nkilian



Joined: 10 Dec 2009
Posts: 11
Location: South Africa

PostPosted: Mon Mar 05, 2012 4:15 pm    Post subject: Reply with quote

Thanks Brian, any idea when there'll be a viable workaround or built-in solution?
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Brian Donahue



Joined: 23 Aug 2004
Posts: 6677

PostPosted: Mon Mar 05, 2012 4:46 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
nkilian



Joined: 10 Dec 2009
Posts: 11
Location: South Africa

PostPosted: Thu Mar 15, 2012 12:35 pm    Post subject: Reply with quote

Yup, tried that, no success either.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Go to page 1, 2  Next
Page 1 of 2

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group