visual studio 2017 adding extra dll in output \bin\debug

visual-studio, wpf

Solution

Suggested Title (I cannot edit) : Why Visual Studio 2017 adds Microsoft and Visual Studio dlls in bin folders (debug/release)

I've found the reason : It is due to Microsoft Report Viewer 14.

To reproduce:

- Create a new project, add any DLL you want (except Nuget for ReportViewer 14) and compile : no useless file.

- Then, add ReportViewer 14 : boom, tons of useless files.

SOLUTION :

In your Project

in the Reference section

- Select the Microsoft.ReportViewer.Design library

- Set "copy Local" to FALSE

- This dll is not mendatory when you distribute your app.

To name a few (to help google searching) :

Microsoft.VisualStudio.CoreUtility.dll, 
Microsoft.VisualStudio.Editor.dll, 
Microsoft.VisualStudio.Shell.Interop.dll, 
Microsoft.VisualStudio.Text.UI.dll, 
Microsoft.VisualStudio.VSHelp.dll  (there is like 20 DLLs with Microsoft.VisualStudio.*.dll)

Problem

I am using Visual Studio Community, 2017, Version 15.1. WPF app with win forms report control. Just moved to SQLite from SQL Server. Now have extra 21 files in \bin\debug (named Microsoft.VisualStudio.*.dll) such as Microsoft.VisualStudio.VSHelp.dll. Manually removing these files, app runs fine. Looked at NuGet config and all seems well. Any ideas?

Original source