1

I have three dlls:

  • DocumentFormat.OpenXml.dll - This is a Microsoft dll for interacting with their XML Office documents (i.e. .xlsx, .docx, etc). It is not very easy to use, which is why I'm using...
  • ClosedXML.dll - This is a wrapper around DocumentFormat.
  • MyHelper.dll - This is my assembly I've created that directly references ClosedXML, but not DocumentFormat.

I am using MyHelper in multiple applications that I'm publishing with ClickOnce. By default, the ClickOnce application does copy MyHelper and ClosedXML to the ClickOnce deployment folder, but does not copy DocumentFormat. Looking at the ClickOnce Project's 'Properties' -> 'Publish' -> 'Application Files...', it shows that DocumentFormat has been set to 'Prerequisite (Auto)' where as ClosedXML and MyHelper are set to 'Include (Auto)'. I would like to configure MyHelper/DocumentFormat so that DocumentFormat gets set to 'Include (Auto)' as well.

Community
  • 1
  • 1
tehDorf
  • 775
  • 1
  • 11
  • 32

1 Answers1

1

Based off this answer, I took a guess and deleted the DocumentFormat folder from my local C:\Windows\Microsoft.NET\assembly\GAC_MSIL\ folder. Apparently that is "the Framework SDK folder" because the MSDN article doesn't give you it. I actually did a search of my entire drive for the DocumentFormat dll, and that was the only non-project sub-folder it appeared in.

After I did that I opened the project back up and the 'Copy Local' setting was set to 'True' for the DocumentFormat reference in MyHelper. It also updated the ClickOnce 'Application Files...' setting to 'Include (Auto)' from 'Prerequisite (Auto)'.

If someone else tries this and the setting didn't update, I would try deleting and re-adding the reference to clear out any existing setting override for it.

I'm not sure if it's a bug or if it is by design, but it seems like the ClickOnce applications are ignoring MyHelper's Copy Local setting overrides and using the default settings for all the dlls.

Community
  • 1
  • 1
tehDorf
  • 775
  • 1
  • 11
  • 32
  • Seems to work, but I didn't need to delete anything form the GAC folder. These steps seemed sufficient: 1). Ensured that `Copy Local` was `True` for `DocumentFormat.OpenXML` under the project's References (also ensure that the dependency of WindowsBase's `Copy Local` setting is set to `True` too) 2). Went to the ClickOnce `Application Files...` settings dialog and changed `DocumentFormat.OpenXML` row to say `Include` (it previously read 'Prerequisite (Auto)' like @tehDorf said). – ErrCode Sep 12 '17 at 03:46