0

After building the release version for my application, I went to the bin/Release folder and saw a bunch of my project dependencies, such as "Newtonsoft.Json.dll", "System.Memory.dll" and so on.

I have referenced posts like What files are mandatory in release windows form? and saw that these dependencies are needed for my application to run smoothly.

However, I only needed to copy one file - my "main.dll" to the application (I'm creating an add-on for Revit) and it works fine. So, I'm wondering which files could be excluded? This is because my application is still being modified and new dependencies are being added, and I would like to know which files are not needed.

Is there a list of dependencies that have already been included in windows automatically?

Joel Shen
  • 15
  • 3

1 Answers1

0

In short, you probably need them all and sometimes some. The long version -- it depends. Below is not an exhaustive list but some points to consider:

  • Whatever is part of the .NET framework that you are using is not normally copied to the output directory
  • The examples that you listed normally should be copied to the output as they are not part of .NET Framework
  • You can force a reference to be copied by setting Copy Local to true, which would result in a potentially unnecessary DLL in your output directory
  • You may have some dependencies in the GAC, which means they might not be copied to the output directory. For example, are you using Infragistics, etc. controls -- do all of your users have them installed on their machines? Probably not and they probably shouldn't, so include them...
  • The compiler is generally smart about not including things to which you have no actual code references (this can lead to problems if there are dynamic invocations only)
Igor Pashchuk
  • 2,455
  • 2
  • 22
  • 29