1

I am adding Open XML functionality to an Office VSTO add-in built in Visual Studio 2012 and 2010. This requires adding two references to my VS project: DocumentFormat.OpenXml.dll and WindowsBase.dll. My concern is that these DLLs won't be present on end users' computers, and the code will throw an error when run on their computers. Two questions:

1) Is it safe to assume that these two DLLs are present on my users' PCs (just like I can safely assume that System.Xml.dll is)? Do they install automatically with Windows and/or Office, or are they included in some sort of Windows/Office update that everyone generally has installed?

2) If not, what is the best way to ensure that my add-in will run on their computers? Do I need to include these as prerequisites in my installer? Set the CopyLocal property = True?

I did find this similar question on SO:

Is OpenXML SDK required to be installed in every computer that will run my program?

but the entering assumption is that CopyLocal is already set to True. I would prefer avoid that if possible. Also, the solution is not really a solution because the author says no action is required. Vallo's comment to the accepted solution seems more helpful, but it appears to require unintuitive additional action by the end user that I want to avoid.

Community
  • 1
  • 1
OfficeAddinDev
  • 1,105
  • 3
  • 15
  • 29

2 Answers2

0

So let me answer you with my knowledge

  1. Assuming user would have Open XML installed is not a good move. And as you think it doesn't come with any updates or office installation [Open XML works independent from office packages. That's why you can generate Open XML files without Excel or any other office package]

  2. Yes , the best thing is to deliver .dll with your solution to end user. Here is the catch, when you install Open XML SDK on your machine you went through a license agreement. I welcome you to remove and re-install Open XMl SDK so you can see license agreement contents [you won't find that agreement in any other place]. It clearly say .dll is free to use and deliver [yes with some restrictions- just go through it].

So what you can do ?

I'm currently working with a product where I had to use Open XML SDK. What I did was I added .dll to our product's third party resources section and delivered it to customers. I think that's the easiest thing you can do.

Else you have another option. You can ask customers who use your product and who needs to use Open XML dependence functionality in your product to install Open XML SDK to their machines.

In conclusion you need .dll to have in your machine locally to use Open XML SDK. So your customers too should have .dll with them to get Open XML SDK dependency functionality.

Hope you got some idea and I helped with your situation.

NOTE - You "DocumentFormat.OpenXml.dll" is the .dll I'm taliking here. "WindowsBase.dll" is present in .net framework

Kavindu Dodanduwa
  • 12,193
  • 3
  • 33
  • 46
0

DocumentFormat.OpenXml.dll is part of the Office Open XML SDK. There's no reason for your clients to install the whole SDK.

So yes, you have to ship DocumentFormat.OpenXml.dll to them by setting CopyLocal to True.

WindowsBase.dll is part of the .NET Framework so you don't have to manually include this one.

Mihai Dinculescu
  • 19,743
  • 8
  • 55
  • 70