加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – .NET是否有链接器?

发布时间:2020-12-15 08:28:13 所属栏目:百科 来源:网络整理
导读:From Jon Skeet’s blog: 以下评论意味着什么? // The line below only works when linked rather than // referenced,as otherwise you need a cast. // The compiler treats it as if it both takes and // returns a dynamic value. string value = com.
From Jon Skeet’s blog:

以下评论意味着什么?

// The line below only works when linked rather than
    // referenced,as otherwise you need a cast.
    // The compiler treats it as if it both takes and
    // returns a dynamic value.
    string value = com.MakeMeDynamic(10);

我理解引用程序集的内容.您可以在命令行使用/ ref:开关编译程序文件时引用它,也可以在Visual Studio中向程序集添加静态引用.

但是如何链接到.NET中的程序集?他的意思是,使用Reflection(Assembly.LoadFile())加载程序集?或者,Win32 API LoadLibrary()?或者,.NET是否有我从未听说过的链接器?

解决方法

它主要用于COM主互操作程序集.在.NET 4中,您可以正常引用它们,也可以“链接”/“嵌入”它们 – 在这种情况下,您最终只会将您感兴趣的PIA位嵌入到您自己的程序集中.

从命令行,这是C#4编译器的/ link:选项.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读