Slinky
Slinky

Reputation: 5832

Post-build ditrective syntax

I received this dreaded error, related to ClosedXML, when I deployed my project to the server.

The project runs locally, though.

Could not load file or assembly 'DocumentFormat.OpenXml, Version=2.5.5631.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

So I placed the "missing" DLL file in /binDLL

I then added the following cmd line directive:

Copy "$(SolutionDir)binDLL\DocumentFormat.OpenXml.dll" "$(ProjectDir)$(OutDir)"

When I build, I get a build error

Error   17  The command "Copy "C:\Projects\MyProject\binDLL\DocumentFormat.OpenXml.dll" "C:\Projects\MyProject\bin\"" exited with code 1

Upvotes: 0

Views: 39

Answers (1)

walther
walther

Reputation: 13600

I don't see a reason to do it like this. Simply open References in Solution Explorer, right click on the reference in question, choose Properties and set Copy Local to True. That should do the trick.

Upvotes: 1

Related Questions