缺少嵌入互操作类型属性属性、类型、操作

2023-09-04 01:02:23 作者:寒离殇

在一个C#项目,我得到以下警告:

In one C# project, I get the following warning:

警告CS1762:参考的形成是因为间接参照由汇编ALibraryOfMine.dll创建组件嵌入的互操作程序集Interop.SomeLibrary.dll。考虑更改汇编语言上的嵌入互操作类型属性。

warning CS1762: A reference was created to embedded interop assembly 'Interop.SomeLibrary.dll' because of an indirect reference to that assembly created by assembly 'ALibraryOfMine.dll'. Consider changing the 'Embed Interop Types' property on either assembly.

不过,在C#项目,让这个警告,我没有看到对COM库引用属性的嵌入互操作类型物业。那是在2010年VS在VS 2008 ALibraryOfMine项目,同一个COM库还没有一个嵌入互操作类型物业。我怎样才能摆脱这个警告?我已经收到找到的程序集清单定义不匹配的程序集引用的错误,我的COM库担心也许不同的版本是它的后面,所以我想以消除COM相关的错误。

However, in the C# project that gives this warning, I do not see an Embed Interop Types property on the COM library reference Properties. That's in VS 2010. In the VS 2008 ALibraryOfMine project, the same COM library also does not have an Embed Interop Types property. How can I get rid of this warning? I've been getting an "The located assembly's manifest definition does not match the assembly reference" error and I'm worried maybe differing versions of a COM library is behind it, so I wanted to eliminate COM-related errors.

推荐答案

您需要到该DLL的引用,右键点击及其性质。正是在那里,而不是在项目的属性

You need to go to the Dll in the References, Right Click and Properites. It is there, not on the properties of your project