互操作类型无法嵌入

最后都变了- 提交于 2020-08-13 17:18:20

问题:

I am creating a web application on the .NET 4.0 framework (beta2) in C#. 我正在用C#在.NET 4.0框架(beta2)上创建一个Web应用程序。

When I try to use a assembly called "ActiveHomeScriptLib", I get the following error: 当我尝试使用名为“ ActiveHomeScriptLib”的程序集时,出现以下错误:

Interop type 'ActiveHomeScriptLib.ActiveHomeClass' cannot be embedded. 无法嵌入互操作类型“ ActiveHomeScriptLib.ActiveHomeClass”。 Use the applicable interface instead. 请改用适用的界面。

When I change the framework to version 3.5, I don't have any errors. 当我将框架更改为版本3.5时,我没有任何错误。

What is an Interop Type and why does this only occur when I use the 4.0 framework? 什么是互操作类型?为什么仅在使用4.0框架时才会发生这种情况?


解决方案:

参考一: https://stackoom.com/question/AQ71/互操作类型无法嵌入
参考二: https://oldbug.net/q/AQ71/Interop-type-cannot-be-embedded
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!