Mergning DocumentFormat.OpenXml

MiffeMiffe Posts: 3
edited March 2, 2015 10:26AM in SmartAssembly

I'm trying to merge with the DocumentFormat.OpenXml assembly from the Microsoft OpenXML SDK.

But it doesnt show up in the Dependencies Merging section of SmartAssembly.
If I force it by editing the .saproj file and set the Merge="1" attribute it gives me the error message: "Your settings require that the assembly 'DocumentFormat.OpenXml, Version=2.5.5631.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is merged, but it must not be due to other restrictions."

How can I find out what those restrictions are and what can I do about it?

Embeddning it would be an acceptable solution, but its not available under Dependencies Embedding either.


  • Alex BAlex B Posts: 971 Diamond 3
    Hello Miffe,

    There are several instances where merging will not occur listed in the documentation. The one to note here is:
    SmartAssembly will never merge or embed the following types of dependency:
    Dependencies signed using Microsoft's strong-naming key (PublicKeyToken 31bf3856ad364e35)

    This is the PublicKeyToken for that assembly and so it will not be able to merge. You may also want to look over the documentation for embedding to see if any of those restrictions apply that would prevent the embedding of the assembly as well.

    I hope this helps!

    Kind regards,
    Product Support Engineer | Redgate Software

    Have you visited our Help Center?
  • Removing the strongname from the assembly with ildasm/ilasm makes it work with both merging and embedding. Thanks for pointing me in the right direction.

    What is the reason for not allowing merging/embedding things signed by Microsoft? Is it just to stop people from merging the entire .NET framework?

    Since this assembly is not part of the framework but is just signed with their key, there really should be a way to override this behaviour.
  • Hi Miffe,

    Glad it got you to where you needed :-) I reread my post and smacked myself since I swear I put that line in about the ildasm/ilasm.

    At any rate...

    I think it may have to do with it being installed in the GAC and the verification process that entails. Have a look at this msdn page.

    Anyway, let us know if you need anything further!

    Kind regards,
    Product Support Engineer | Redgate Software

    Have you visited our Help Center?
Sign In or Register to comment.