Options

Dynamic dlls

alexander@gonline.bealexander@gonline.be Posts: 7 New member
edited February 23, 2016 11:38AM in SmartAssembly
Hi

One of my projects is using assemblies of which I assume they are loaded dynamically. System.Net.Http.Extensions, Formatting and Primitives from Microsoft.

Isn't there any way I can include them inside the single exe generated by sa? This is really annoying, since it makes deployment much more complicated.

Anything I can try?

kind regards

Alexander

Comments

  • Options
    Hi Alexander,

    It sounds like you want to embed the dependencies - see the documentation here. This will compress and include the dependencies in the main executable.

    Kind regards,
    Alex
    Product Support Engineer | Redgate Software

    Have you visited our Help Center?
  • Options
    Hi Alex

    The problem is that these assemblies don't show up in the list of possible assemblies to embed. I would love a way to force assemblies to be embedded, even when sa doesn't detect them.

    kind regards
  • Options
    Jessica RJessica R Posts: 1,319 Rose Gold 4
    Hi Alexander!

    I'm afraid that if the assemblies are only loaded dynamically, SmartAssembly cannot embed them due to some technical limitations. :/ In some cases though, it has worked to create a dummy call to a dynamically loaded assembly in order to get it to appear in the list and embed it.

    For dependencies that are already directly referenced and called on by the main assembly but aren't showing up in the list though, this is likely because they are signed with the Microsoft public key token--SmartAssembly hides these by default since they're assumed to be framework assemblies and most users running a .NET application already the framework installed. However, there is a way to force it to show these by adding the SupportsMergingFramework registry key:

    1) Open your registry editor
    2) Navigate to HKEY_LOCAL_MACHINESOFTWAREWow6432NodeRed GateSmartAssembly 6 (or HKEY_LOCAL_MACHINESOFTWARERed GateSmartAssembly 6 if you happen to be using the 64-bit version of SA (v6.10))
    3) Create a String value named "SupportsMergingFramework" with value 1

    Then once you re-open SmartAssembly, the referenced Microsoft libraries should appear in the list. (Alternatively, you could also resign each of the Microsoft assemblies with your own key as described here: viewtopic.php?t=16679)

    I hope this info helps!

    Jessica Ramos | Product Support Engineer | Redgate Software

    Have you visited our Help Center?


Sign In or Register to comment.