visual studio 2017在output \ bin \ debug中添加额外的dll

时间:2017-05-02 16:14:19

标签: wpf visual-studio

我正在使用Visual Studio Community,2017年版本15.1。带有win form报告控件的WPF应用程序。刚刚从SQL Server迁移到SQLite。现在在\ bin \ debug(名为Microsoft.VisualStudio。* .dll)中有额外的21个文件,例如Microsoft.VisualStudio.VSHelp.dll。手动删除这些文件,应用运行正常。 看着NuGet配置,一切看起来都很好。有什么想法吗?

1 个答案:

答案 0 :(得分:8)

推荐标题(我无法编辑):为什么Visual Studio 2017在bin文件夹中添加Microsoft和Visual Studio dll(调试/发布)

我找到了原因:这是由于Microsoft Report Viewer 14

要重现:

  • 创建一个新项目,添加你想要的任何DLL(除了Nuget for ReportViewer 14)并编译:没有无用的文件。
  • 然后,添加ReportViewer 14:繁荣,大量无用文件。

解决方案

  • 在您的项目中

  • 参考部分

  • 选择Microsoft.ReportViewer.Design库
  • 将“copy Local”设置为FALSE
  • 当您分发应用时,此dll不是一种修饰。

仅举几例(帮助谷歌搜索):

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)