1

I have a C# .NET 4.6.2 project that references a Nuget package which adds 2 files, a .DLL and a .XML. The .XML file is actually not needed for deployment. How can I exclude that file from my build output?

For specifics, my project references ClosedXML, which in turn references DocumentFormat.OpenXml. That package adds DocumentFormat.OpenXml.dll and DocumentFormat.OpenXml.xml. The XML file is 15MB and optional.

user9057586
  • 133
  • 7
  • Use exlude in nuspec file - https://stackoverflow.com/questions/14452608/how-to-exclude-a-folder-from-a-nuget-package – Michael Gabbay Jan 28 '21 at 18:38
  • @MichaelGabbay Isn't that for when you're building a nuget file yourself? In my case I am not. – user9057586 Jan 28 '21 at 18:48
  • 1
    There was another comment here that suggested another question, which had a workaround in one of its answers that worked for me. In a nutshell it involves creating a custom target to delete the file in question. A bit hacky, but it's better than nothing. Stackoverflow closed my question when I agreed that the other one worked for me. Here it is: https://stackoverflow.com/a/55109516/ – user9057586 Jan 28 '21 at 22:24
  • 1
    Another one here: https://stackoverflow.com/a/64275486/ – user9057586 Jan 28 '21 at 22:26

0 Answers0