Obfuscation of word addin

harabin.tomasharabin.tomas Posts: 5
edited January 7, 2015 6:54PM in SmartAssembly
Hello,
i have problem with obfuscation (even empty, created from vs template) of word add-in. On all of my computers building in smartassembly has error:
SmartAssembly has encountered an invalid symbol:
[Microsoft.Office.Tools.Common.v4.0.Utilities]Microsoft.Office.Tools.Ribbon.RibbonBase::.ctor instance System.Void(class [Microsoft.Office.Tools.Common]Microsoft.Office.Tools.Ribbon.RibbonFactory)
The most likely cause is that SmartAssembly has used a different version of a dependency from the version used by Titan.OutlookAddIn.dll.
If the details below are wrong, please use the MandatoryPath attribute in the .saproj file to ensure that the correct version of the dependency is found.
Assembly that should contain the missing symbol: C:Program FilesReference AssembliesMicrosoftVSTO40v4.0.FrameworkMicrosoft.Office.Tools.Common.v4.0.Utilities.dll

But assembly references the same assembly in same path a is working correctly (unobfuscated version).

Is Office AddIn compatible with SmartAssembly?

Comments

  • Hi,

    This error happens if SmartAssembly tries to use a different version of the dependency. For example, if a different version of the Office Addin DLL is already in your GAC, SmartAssembly may try to use that incompatible version instead of the correct one. As the error message explains, you can normally solve this by using the MandatoryPath attribute.

    For more information, see https://documentation.red-gate.com/disp ... pendencies

    Thanks,
    Dom.
    Dominic Smith,
    Project Manager,
    Redgate.
  • I have used MandatoryPath attribute and error still exists. MandatoryPath is the same as path in References in project settings in Visual Studio.
    Is there some other reason for this error message?
    This assembly is not in GAC.
  • Hi Tomas!

    Can I please check--is your addin written in VB?

    I've seen this error once before and from what was gathered, the invalid symbol error seems to happen only with VB office addins on SmartAssembly 6.5 and later.

    Apologies as I realize it's not ideal, but could you kindly give version 6.2 (the latest release before 6.5) a try? You can download it from here: http://downloads.red-gate.com/checkforu ... .2.215.exe

    Jessica Ramos | Product Support Engineer | Redgate Software

    Have you visited our Help Center?


  • Hi Jessica,
    thanks for your post, with version 6.2 is everything OK, obfuscation is successfully performed.

    Info to your question:
    - I need to obfuscate Word and Outlook addin written in VB.NET (same error has occured)
    - I tried it on 2 computers and on clean installation of Windows 7 x64
    - Same result I get if I try to obfuscate even blank addin created from template in VS2013 and in VS2010
  • In version 6.2 is obfuscation performed, but there are some other problems. Obfuscated assembly does not work on computer with .NET 4.0 (unobfuscated versio is working correctly), because is trying to find System.Windows.Input.ICommand in System.dll. On .NET4.0 is located in PresentationCore.dll.

    So, it is possible to expect new version of SmartAssembly without these problems?
  • So sorry another issue has come up! The ICommand problem happens with older versions of SA when .NET 4.5 is installed.

    I've logged a bug for the original issue with Microsoft.Office.Tools.Common.v4.0.Utilities (SA-1873) but I'm afraid we don't yet have a timeline for when it can be fully investigated. :/

    Apologies for another non-ideal workaround, but do you have another build machine where .NET 4.5 is not installed that you could use for now with version 6.2?

    Jessica Ramos | Product Support Engineer | Redgate Software

    Have you visited our Help Center?


Sign In or Register to comment.