- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在早期版本的 Visual Studio 中,这些 DLL 不会添加到我的项目中。我的猜测是我的引用文献之一依赖于这些 DLL。根据我的阅读,突出显示的 Microsoft.Office.Interop.Excel
可能就是其中之一。谁能证实这一点吗?我还应该注意到,即使我将它们从项目中排除,VS 2015 也总是发布这些 DLL。如果我删除它们,VS 2015 会重新制作它们。
编辑:我已确认 Excel 和 Office 引用是导致包含 stdole.dll 的原因。请参阅下面选定的答案以删除 stdole.dll。
我已经划掉了自定义引用。如果需要更多信息,请告诉我。这是我当前的引用资料:
最佳答案
正如其他人指出的,stdole.dll
是一组 Office COM 互操作组件的主要互操作程序集。您可以通过执行以下操作来确定将其包含在您的项目中的原因。
在 Visual Studio 中,转到工具 > 选项 > 项目和解决方案 > 生成并运行
。将“MSBuild 项目生成输出详细程度”设置更改为详细
。现在清理并重建您的项目。
打开输出窗口并搜索 stdole
。您应该找到这样的部分:
25> Dependency "stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
25> Resolved file path is "D:\Program Files (x86)\Microsoft Visual Studio 12.0\Visual Studio Tools for Office\PIA\Common\stdole.dll".
25> Reference found at search path location "{Registry:Software\Microsoft\.NETFramework,v4.0,AssemblyFoldersEx}".
25> For SearchPath "D:\Git\FoobarServices\Dependencies\Dependencies".
25> Considered "D:\Git\FoobarServices\Dependencies\stdole.winmd", but it didn't exist.
25> Considered "D:\Git\FoobarServices\Dependencies\stdole.dll", but it didn't exist.
25> Considered "D:\Git\FoobarServices\Dependencies\stdole.exe", but it didn't exist.
25> For SearchPath "{CandidateAssemblyFiles}".
25> Considered "Dependencies\CrystalDecisions.CrystalReports.Engine.dll", but its name "CrystalDecisions.CrystalReports.Engine" didn't match.
25> Considered "Dependencies\CrystalDecisions.Enterprise.Framework.dll", but its name "CrystalDecisions.Enterprise.Framework" didn't match.
25> Considered "Dependencies\CrystalDecisions.Enterprise.InfoStore.dll", but its name "CrystalDecisions.Enterprise.InfoStore" didn't match.
25> Considered "Dependencies\CrystalDecisions.ReportSource.dll", but its name "CrystalDecisions.ReportSource" didn't match.
25> Considered "Dependencies\CrystalDecisions.Shared.dll", but its name "CrystalDecisions.Shared" didn't match.
25> Considered "Dependencies\CrystalDecisions.Web.dll", but its name "CrystalDecisions.Web" didn't match.
25> For SearchPath "{TargetFrameworkDirectory}".
25> Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\stdole.winmd", but it didn't exist.
25> Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\stdole.dll", but it didn't exist.
25> Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\stdole.exe", but it didn't exist.
25> For SearchPath "{Registry:Software\Microsoft\.NETFramework,v4.0,AssemblyFoldersEx}".
25> Considered AssemblyFoldersEx locations.
25> Required by "CrystalDecisions.Web, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=MSIL".
25> Required by "CrystalDecisions.ReportSource, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=MSIL".
25> Required by "CrystalDecisions.CrystalReports.Engine, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=MSIL".
25> Required by "CrystalDecisions.Enterprise.InfoStore, Version=11.5.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304".
25> The ImageRuntimeVersion for this reference is "v1.0.3705".
您可以在底部看到 Visual Studio 在何处搜索程序集以及需要它的内容。就我而言,它是一堆旧的 Crystal Reports 程序集。
有时您可以按照托尼的建议通过依赖项嵌入互操作类型,但并非总是如此。对我来说,Crystal Reports 程序集不支持此功能。
我通过从 C:\Program Files (x86)\Microsoft.NET 复制
到我的项目内的“依赖项”文件夹中。我将该文件添加到我的项目中,并添加了对其的显式引用(“添加引用”>“浏览”)。最后,我打开了新引用的属性并将stdole.dll
(32KB,数字签名)解决了这个问题(以及 scottsanpedro 提到的阴险问题)\Primary Interop Assemblies\Embed Interop Types
设置为True
。
这似乎是一个更好的情况。我不需要担心获得未签名版本的程序集。
关于dll - 为什么 Visual Studio 2015 将 stdole.dll 和 Microsoft.AnalysisServices.AdomdClient.dll 添加到我的项目中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31970967/
我想将 AdomdClient 引用添加到 C# 项目,但它不在引用列表中。客户端列在程序集文件夹 C:\Windows\Assembly 中。 计算机上安装了 SQL Server 2012。 最佳
我想将 AdomdClient 引用添加到 C# 项目,但它不在引用列表中。客户端列在程序集文件夹 C:\Windows\Assembly 中。 计算机上安装了 SQL Server 2012。 最佳
在早期版本的 Visual Studio 中,这些 DLL 不会添加到我的项目中。我的猜测是我的引用文献之一依赖于这些 DLL。根据我的阅读,突出显示的 Microsoft.Office.Intero
我是一名优秀的程序员,十分优秀!