博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
C# - 设置DLL的属性Embed Interop Type 设为False
阅读量:5876 次
发布时间:2019-06-19

本文共 1648 字,大约阅读时间需要 5 分钟。

错误:

Error msg: A reference was created to embedded interop assembly. because of an indirect reference to that assembly created by assembly. Consider changing the 'Embed Interop Types' property on either assembly.

 

解决方法:

      将DLL的属性Embed Interop Type 设为False.  否则会引起互操作类型异常。

  当设置为True时,该COM组件的交互类型信息将在编译时被嵌入到项目的类库中。

  当设置为False时,该COM组件的交互类型都需要一个额外的Primary Interop Assemblies(PIA)来提供。但是Net中已经将其封装了,对开发者而言是透明的。 参考

 

官方解释:

A reference was created to embedded interop assembly '<assembly1>' because of an indirect reference to that assembly from assembly '<assembly2>'. Consider changing the 'Embed Interop Types' property on either assembly.

 

You have added a reference to an assembly (assembly1) that has the Embed Interop Types property set to True. This instructs the compiler to embed interop type information from that assembly. However, the compiler cannot embed interop type information from that assembly because another assembly that you have referenced (assembly2) also references that assembly (assembly1) and has the Embed Interop Types property set to False.

Note                   Note                

Setting the Embed Interop Types property on an assembly reference to True is equivalent to referencing the assembly by using the /link option for the command-line compiler.

Error ID: BC40059

To address this warning

  • To embed interop type information for both assemblies, set the Embed Interop Types property on all references to assembly1 to True.

  • To remove the warning, you can set the Embed Interop Types property of assembly1 to False. In this case, interop type information is provided by a primary interop assembly (PIA).

 

其他参考:

 

 

 

转载于:https://www.cnblogs.com/viviancc/p/3826289.html

你可能感兴趣的文章
Hyperledger Fabric周周记:起源
查看>>
CSS查漏补缺
查看>>
写一个“特殊”的查询构造器 - (三、条件查询)
查看>>
[LeetCode] Reverse Words in a String II
查看>>
CentOS安装GraphicsMagick
查看>>
promise化微信小程序api
查看>>
JavaScript函数式编程之管道分支,消除if/else的一种方式
查看>>
浅谈BFC
查看>>
springBoot的工作机制--springBoot揭秘
查看>>
webclient对reactor-netty的封装
查看>>
c++ 于编译期检测两个类型之间是否可以转化
查看>>
结合kmp算法的匹配动画浅析其基本思想
查看>>
WPF:Animation动画-TargetValues目标值From、To、By动画
查看>>
vue进行wepack打包执行npm run build出现错误
查看>>
nginx搭建
查看>>
【d3.js v4基础】过渡transition
查看>>
VUEJS开发规范
查看>>
Android系统的创世之初以及Activity的生命周期
查看>>
彻底解决Linux下memcached的安装
查看>>
人人都会数据采集- Scrapy 爬虫框架入门
查看>>