Visual Studio 2010:嵌入互操作类型
I found some information about this on Scott Hanselmans Blog
Does anybody exactly know what this mean?
Is this only for the Office Primary Interop Assemblies, or can I also use this to Embed my Redemption library or other COM libraries?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Scott Hanselman 的博客中描述的过程称为“类型等效”,这是 CLR 4.0 对 COM 互操作类型程序集支持的一个相当模糊的术语。虽然我还没有机会观看,但第 9 频道有一个视频对此进行了讨论:
Raja Krishnaswamy 和 Vance Morrison:CLR 4 - 内部类型等效
http ://channel9.msdn.com/shows/Going+Deep/Raja-Krishnaswamy-and-Vance-Morrison-CLR-4-Inside-Type-Equivalence/
显然,您可以编写自己的“类型等效”程序集,并嵌入它们。请注意,这可能不仅仅适用于任何 COM 程序集;类型等效程序集实现一个名为
IApplication
的接口。请参阅此处:.NET 类型系统的进展:类型等效演示
http: //blogs.msdn.com/mshneer/archive/2008/10/28/advances-in-net-type-system-type-equivalence-demo.aspx
The process described in Scott Hanselman's blog is called Type Equivalence, a rather nebulous term for the CLR 4.0's support for COM interop type assemblies. Although I haven't had a chance to look at it, there is a video here at Channel 9 that discusses it:
Raja Krishnaswamy and Vance Morrison: CLR 4 - Inside Type Equivalence
http://channel9.msdn.com/shows/Going+Deep/Raja-Krishnaswamy-and-Vance-Morrison-CLR-4-Inside-Type-Equivalence/
Apparently you can write your own "type equivalence" assemblies, and embed them. Note that this probably does not apply to just any COM assembly; type equivalence assemblies implement an interface called
IApplication
. See here:Advances in .NET Type system: Type Equivalence Demo
http://blogs.msdn.com/mshneer/archive/2008/10/28/advances-in-net-type-system-type-equivalence-demo.aspx
关于以下的一点评论:如果您添加引用和属性“Embed Interop Types = true” - 这可能会在编译时产生一些因果错误: - 您会看到内部引用具有函数和属性 - 但编译器没有找不到它并产生错误!
One remark about: if you add reference and property "Embed Interop Types = true " - this can make some casuistic errors while you compiling : - you see what inside reference have functions and propertyes - but compilator don't find it and generate errors !