2015-11-19 92 views
7

我有以下情况:
解决方案与为什么我的LocalCopy dll不是从参考项目中的参考项目本地复制的?

- Project 1: Web_Application (VB.NET Web Application) 
- Project 2: Code_Library (VB.NET DLL, Referenced in Project 1, References My_Reports, My_SQL) 
- Project 3: My_SQL (Embedded SQL scripts C# DLL, referenced in Code_Library) 
- Project 4: MyReports (C# dll, depends on ReportViewer), 
       referenced in Code_library, copyLocal = true 
       unfortunately depends on 
        - Microsoft.ReportViewer.WebForms.dll (copyLocal = true) 
        which depends on 
        - Microsoft.ReportViewer.Common.dll (copyLocal = true) 
        - Microsoft.ReportViewer.ProcessingObjectModel.dll (copyLocal = true) 
        - System.Web.DataVisualization.dll (copyLocal = true) 

中的ReportViewer DLL的设置在MyReports作为以localcopy项目
在Code_Library,MyReports作为被设置为localcopy
在Web_Application,Code_Library & MyReports作为设置到localcopy

这给出了以下非常不满意的结果:
在MyReports中,R eportViewer的dll被localcopied到输出目录。
在Code_Library中,MyReports.dll位于输出目录中,但ReportViewer DLL不是...
在Web_Application中,CodeLibrary.dll & MyReports.dll位于输出目录中,但ReportViewer DLL不是...

为什么?
有什么我可以做的(短添加的ReportViewer的dll对我的网络应用程序项目的?

我绝对不希望中的ReportViewer添加为depencency到Code_Library,从那时起我要更新2个位置,如果我想换到更高版本的ReportViewer的

+0

已打开连接问题https://connect.microsoft.com/VisualStudio/feedback/details/2035442 –

+0

开发计算机上的问题dll是GAC的一部分吗?如果是这样,删除它们可能会帮助视觉工作室意识到满足本地依赖性的需要。 – grek40

+0

@ grek4:他们很可能在GAC中。我无法删除它们,我没有管理员权限。其他开发者也没有。我还安装了SQL Server Express&Management Studio,所以我不能说这些程序集是否安装了标准的.NET 2.0安装程序。另外,如果在.NET 4.0应用程序池上运行,.NET 2.0 dll可能不会在生产计算机上。 –

回答

0

我有几个选择:

  1. GAC你不引用要复制
  2. 参考他们在app.config文件 - 阿拉this
  3. 添加postbuild事件将文件复制到你需要他们...

你可以检查出其中的应用程序由enabling fusion logging查找的文件。

+0

选项1是不可能的,因为我们的客户服务器上没有管理员权限。选项2非常令人不满意,因为多个Web_Application项目(针对不同客户)使用Code_Library。选项3,固定路径,只能在我的电脑上运行。使用相对路径,只能在具有相同目录结构的计算机上工作。 –

+0

您可能会在参考项目中嵌入间接引用ala [this](http://stackoverflow.com/a/13766575/2319909) –

+0

嗯,ilMerge会是一个想法。 –