wpf - C# Cannot be used across assembly boundaries because it has a generic type parameters that is an embedded interop type -
i facing error c# (wpf). link has not been useful
cannot used across assembly boundaries because has generic type parameters embedded interop type
just explain structure of program can tell that:
i using library made external company. can call pcdlrn
in solution have project made me incluse types in previous lib. in library define:
public observablecollection<pcdlrn.dimensioncmd> obcpcdlrndimensioncommands = new observablecollection<pcdlrn.dimensioncmd>();
in order used in main program. in short:
pcdlrn->mylib obcpcdlrndimensioncommands --> program mypcd.obcpcdlrndimensioncommands
in program want access aforementioned observablecollection doesn't build giving error in title.
--edit--- suggested have changed embedded = true false changing prop in picture error remains
as wasgooddone remarked, need use same class both (all) assemblies use generics.
in other words, if have assembly1
, references interopassembly
, , assembly2
, references same interopassembly
, , switch embedded interop type
true
, have two copies of types interopassembly
.
if want use cross-references assembly1
assembly2
, .net can't resolve it, because point of view, classes different.
when switch embedded option off, assembly reference other assembly contains interop types. , in way can use interop types in different libraries.
so, if have problem described above, means have @ least 2 assemblies referencing pcdlrn, , must switch off embedded interop type
in of them.
Comments
Post a Comment