Interop type cannot be embedded

2019-01-01 04:36发布

I am creating a web application on the .NET 4.0 framework (beta2) in C#.

When I try to use a assembly called "ActiveHomeScriptLib", I get the following error:

Interop type 'ActiveHomeScriptLib.ActiveHomeClass' cannot be embedded. Use the applicable interface instead.

When I change the framework to version 3.5, I don't have any errors.

What is an Interop Type and why does this only occur when I use the 4.0 framework?

9条回答
栀子花@的思念
2楼-- · 2019-01-01 05:14

Like Jan It took me a while to get it .. =S So for anyone else who's blinded with frustration.

  • Right click the offending assembly that you added in the solution explorer under your project References. (In my case WIA)
  • Click properties.
  • And there should be the option there for Embed Interop Assembly.
  • Set it to False
查看更多
浪荡孟婆
3楼-- · 2019-01-01 05:16

Got the solution

Go to references right click the desired dll you will get option "Embed Interop Types" to "False" or "True".

查看更多
荒废的爱情
4楼-- · 2019-01-01 05:18

Here's where to set the Embed Interop in Visual Studio 2012

enter image description here

查看更多
登录 后发表回答