I am facing this error on changing a Sub to a Function in VB.Net
Type System.Collection.Generic.List(Of mshtml.IHTMLDocument2) cannot be used across assembly boundaries because it has a generic type parameters that is an embedded interop type.
Does anyone knows how to get it resolved?
I fixed this by making sure that all assemblies had "Embed Interop Types" to FALSE.
It seems that usually when you use a COM library that parameter is set to true by default.
Changing the return type from List(Of mshtml.IHTMLDocument2) to IList(Of mshtml.IHTMLDocument2) or IEnumerable(Of mshtml.IHTMLDocument2) resolves the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With