为什么 Visual Studio 2015 将 stdole.dll 和 Microsoft.AnalysisServices.AdomdClient.dll 添加到我的项目中? [英] Why is Visual Studio 2015 adding stdole.dll and Microsoft.AnalysisServices.AdomdClient.dll to my project?

查看:17
本文介绍了为什么 Visual Studio 2015 将 stdole.dll 和 Microsoft.AnalysisServices.AdomdClient.dll 添加到我的项目中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在以前版本的 Visual Studio 中,这些 DLL 未添加到我的项目中.我的猜测是我的一个引用依赖于这些 DLL.根据我的阅读,突出显示的 Microsoft.Office.Interop.Excel 可能就是其中之一.任何人都可以证实这一点吗?我还应该注意到,即使我将它们从项目中排除,VS 2015 也总是发布这些 DLL.如果我删除它们,VS 2015 将重新制作它们.

These DLLs are not added to my project in prior versions of Visual Studio. My guess is that one of my references has a dependency to these DLLs. From what I've read, the highlighted Microsoft.Office.Interop.Excel might be the one. Can anyone confirm this? I should also note that VS 2015 always publishes these DLLs as well even if I exclude them from the the project. If I delete them, VS 2015 will remake them.

编辑:我已经确认 Excel 和 Office 引用是导致包含 stdole.dll 的原因.请参阅下面的选定答案以删除 stdole.dll.

Edit: I have confirmed that the Excel and Office references are what's causing the inclusion of stdole.dll. See selected answer below to remove stdole.dll.

我已经划掉了自定义引用.如果需要更多信息,请告诉我.这是我目前的参考资料:

I've crossed out the custom references. Let me know if more information is needed. Here's my current references:

推荐答案

如果可以选择,请使用嵌入互操作类型并将 stdole.dll 放在一起,否则每次移动应用程序时都会遇到问题(新服务器或开发机器)stdole.dll 未签名.

If you have the option, use Embed Interop Types and leave stdole.dll out of it all together or you will run into the problem every time you move the application (new servers or dev machines) where stdole.dll isn't signed.

问题: 有一个需要 stdole.dll 的引用,并且 stdole.dll 现在被自动推送到 bin 文件夹.

Problem: There is a reference that is requiring stdole.dll and stdole.dll is now being automatically pushed to the bin folder.

解决方案:

  • 找到需要 stdole.dll 的参考(更多关于如何在下面执行此操作)
  • 转到它的属性(右键单击->属性)
  • 将嵌入互操作类型"从 false 更改为 true.

如何查找引用:当您单击引用的属性时,请检查嵌入互操作类型"是否设置为 false.为了进一步挖掘,尼克的回答提供了一些很好的信息.

How to find the reference: When you click on the properties of your references, check to see if "Embed Interop Types" is set to false. To dig even further, Nick's answer has some great info.

到目前为止我已经确认使用 stdole.dll 的参考(可能还有更多的办公程序)

References I've confirmed so far that use stdole.dll (probably more office programs as well)

  • 办公室

Excel

核心

Crystal Reports(感谢 Lithium.正如 Nick 指出的,您可能没有设置 Embed Interop Types=true 的优势)

Crystal Reports (Thanks Lithium. As Nick points out, you may not have the advantage of setting Embed Interop Types=true)

如果您发现更多,请将它们添加到此列表中或在评论中注明,我会做的.

If you find more, add them to this list or note them in the comments and I'll do it.

Hans Passant 强烈反对设置 Embed InteropTypes=false 在这里:在 Visual Studio 中设置 Embed Interop Types true 和 false 有什么区别?

Scott Hanselman 还谈到了嵌入互操作类型"的作用:http://www.hanselman.com/blog/CLRAndDLRAndBCLOHMyWhirlwindTourAroundNET4AndVisualStudio2010Beta1.aspx

Scott Hanselman also talks about what the "Embed Interop Types" does here: http://www.hanselman.com/blog/CLRAndDLRAndBCLOhMyWhirlwindTourAroundNET4AndVisualStudio2010Beta1.aspx

这篇关于为什么 Visual Studio 2015 将 stdole.dll 和 Microsoft.AnalysisServices.AdomdClient.dll 添加到我的项目中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆