C# - 设置DLL的属性Embed Interop Type 设为False
错误:
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中已经将其封装了,对开发者而言是透明的。 参考
官方解释:
http://msdn.microsoft.com/en-us/library/ff182188.aspx
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.
![]() |
---|
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).
其他参考:
http://bbs.csdn.net/topics/390599484
C# - 设置DLL的属性Embed Interop Type 设为False的更多相关文章
- C#操作Office- Cannot find the interop type that matches the embedded interop type 'Microsoft.Office.Interop.Excel.Application'
网上说 2003 -> 11.0, 2007 -> 12.0. 因为平时提示"Are you missing an assembly reference?",都是没有引 ...
- 给li设置float浮动属性之后,无法撑开外层ul的问题。
最近在项目中有好几次遇到这个问题,感觉是浮动引起的,虽然用<div style="clear:both"></div>解决了,但自己不是特别明白,又在网上查 ...
- DLL放在指定目录 以及设置dll调用路径
一.DLL放在指定目录 在编写C# winform程序中,不免一个项目会有多个工程文件,而这些工程文件之间是相互引用的,所以不想将工程的生成结果(exe或者dll)放在当前工程bin目录下的Debug ...
- 给li设置float浮动属性之后,无法撑开外层ul的问题。(原址:http://www.cnblogs.com/cielzhao/p/5781462.html)
最近在项目中有好几次遇到这个问题,感觉是浮动引起的,虽然用<div style="clear:both"></div>解决了,但自己不是特别明白,又在网上查 ...
- JQUERY操作html--获取和设置内容、属性、回调函数
一:jQuery - 获取内容和属性 1.获得内容 - text().html() 以及 val() text() - 返回所选元素的文本内容 html() - 返回所选元素的内容(包括 HTML 标 ...
- C#反射技术的简单操作(读取和设置类的属性)
public class A { public int Property1 { get; set; } } static void Main(){ A aa = new A(); Type type ...
- JavaScript(19)jQuery HTML 获取和设置内容和属性
jQuery HTML jQuery 拥有可操作 HTML 元素和属性的强慷慨法. jQuery DOM 操作 jQuery 中非常重要的部分,就是操作 DOM 的能力.jQuery 提供一系列与 D ...
- RMAN增量备份-备份保留策略-设置备份集属性
RMAN增量备份:增量备份级别:0,1,2,3,4BACKUP DATABASE也是创建数据库的完整备份,但是这种备份不同于增量备份的0级备份.这种备份不包含增量备份的0级备份,并不支持在此基础上再创 ...
- 使用storyboard设置button边框属性(颜色,宽度,圆角)
通常使用Category时.仅仅能加入方法,不可加入属性.可是在使用Storyboard时我们可能会使用到keyPath,这里设置的key都须要是所设置视图的属性值.而且类型有所限制. 比如:我如今有 ...
随机推荐
- iOS UILable高度自适应
适用于iOS6以后 NSString *tip = @"UILable高度自适应,UILable高度自适应,UILable高度自适应"; UILabel label_2 = [[U ...
- JavaScript之延迟加载
本文参阅http://www.appelsiini.net/projects/lazyload Javascript Lazyload延迟加载特效,有效降低HTPP连接次数,提高首屏加载时间 1.增加 ...
- 百度网页搜索部来自Console的招聘信息
百度网页搜索部来自Console的招聘信息,小伙伴们,你发现了吗?
- x64、x86_64、x64三者的区别
x86是指intel的开发的一种32位指令集,从386开始时代开始的,一直沿用至今,是一种cisc指令集,所有intel早期的cpu,amd早期的cpu都支持这种指令集,ntel官方文档里面称为“IA ...
- 删除HT和CAS角色与扩展在另一台服务器
背景:原先使用三合一方式部署的架构,如今不再满足企业需求,因此需要将原来的一台服务器多角色的拆分开,即由原来CAS.HT.MBX角色集一台服务器的分成两台服务器来部署,此架构为MBX角色单独部署在 ...
- 表情键盘及文字表情识别简单demo
1.前言 了解了简单图文混排 (属性字符串的使用)及 正则表达式的部分知识,为了加深印象,写了个简单表情键盘demo 展示文字用的是 UITextView 由于时间匆忙,存在一些bug,以及不完善的地 ...
- 【学习笔记】【C语言】第一个C程序
1.新建C语言程序 *打开Xcode *新建文件 *选择C语言程序 *输入程序名称 *选择存放路径 *创建完成后 2.也可以用终端来创建 通过指令来创建.c文件 3.编写代码 4. ...
- socket.io问题,io.sockets.manager.rooms和io.sockets.clients('particular room')这两个函数怎么用?
为什么我用nodejs用这个两个函数获取都会出错呢?是不是socket的api改了?请问现在获取房间数和当前房间的客户怎么获取?什么函数?谢谢!!急求! 网友采纳 版本问题.io.socket ...
- JSP_EL使用
JSP中EL表达式的简单介绍和使用 参考资料: http://www.java3z.com/cwbwebhome/article/article8/8124.html?id=2453 http ...
- Lucene使用IKAnalyzer分词实例 及 IKAnalyzer扩展词库
文章转载自:http://www.cnblogs.com/dennisit/archive/2013/04/07/3005847.html 方案一: 基于配置的词典扩充 项目结构图如下: IK分词器还 ...