有什么区别设置嵌入互操作类型真假在Visual Studio? [英] What's the difference setting Embed Interop Types true and false in Visual Studio?

查看:249
本文介绍了有什么区别设置嵌入互操作类型真假在Visual Studio?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio中,添加一个参照项目时,在属性窗口中有一个选项嵌入Inteop类型,我们应该将它设置为?有什么区别?

In Visual Studio, when adding one reference to the project, the properties window has an option Embed Inteop Types, should we set it to True or False? What's the difference?

由于我们有很多的项目,其中一些人,参考设置为,其他人设置为,这是完全搞砸了。而bulid服务器也有同样的警告:

Since we have a lot of projects, among some of them, reference was set to False, others were set to True, it is totally mess up. And the bulid server also have the same warnings:

<一个href=\"http://stackoverflow.com/questions/8156488/what-does-reference-was-created-to-embedded-interop-assembly-mean\">What并引用是为了嵌入的互操作大会是什么意思?

所以,我们计划将所有的嵌入Inteop类型更改为,我们会得到什么风险?

So we plan to change all the Embed Inteop Types to False, what risk would we get?

推荐答案

这个选项,以消除需要部署非常大的PIA(主互操作程序集)的互操作。介绍

This option was introduced in order to remove the need to deploy very large PIAs (Primary Interop Assemblies) for interop.

它只是嵌入使用的管理桥接code,可以让你去跟非托管程序集,但不是嵌入这一切仅仅创建您在code实际使用的东西。

It simply embeds the managed bridging code used that allows you to talk to unmanaged assemblies, but instead of embedding it all it only creates the stuff you actually use in code.

了解更多斯科特Hanselman的博客文章关于它和其它VS改进<一个href=\"http://www.hanselman.com/blog/CLRAndDLRAndBCLOhMyWhirlwindTourAroundNET4AndVisualStudio2010Beta1.aspx\">here.

Read more in Scott Hanselman's blog post about it and other VS improvements here.

至于是否建议或没有,我不知道,因为我并不需要使用此功能。快速的网络搜索产生了一些线索:

As for whether it is advised or not, I'm not sure as I don't need to use this feature. A quick web search yields a few leads:

  • Check your Embed Interop Types flag when doing Visual Studio extensibility work
  • The Pain of deploying Primary Interop Assemblies

他们都转向假的唯一的风险是更加部署关切PIA文件和更大规模的部署,如果一些这些文件都很大。

The only risk of turning them all to false is more deployment concerns with PIA files and a larger deployment if some of those files are large.

这篇关于有什么区别设置嵌入互操作类型真假在Visual Studio?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆