Today i face one more difficulty in my current project,
i am useing .net 4.0 framework with WPF application.
In this application i am adding one dll file that communicate with COM port and i get error “Interop type cannot be embedded. Use the applicable interface instead.”.
this code is perfactly run with .net 3.5 framework but not in 4.0.
and i get the solution for that as below.
Common Language Runtime in .Net 4.0 supports embedding of COM types information directly into managed assemblies in order to simplify deployment process. Managed assemblies need not have to read type information from interop assemblies any more.
In the managed assembly you can embaded only COM type metadata so it will only works with interfaces, structures, enums and delegates
so what to do for this problem? the solution is “use interfaces instead of classes” or “simply copy constant values from the class definition locally and use them instead.”
hope this will helps you..