What does “reference was created to embedded interop assembly” mean?

前端 未结 1 703
甜味超标
甜味超标 2020-12-24 10:46

I am getting the following warning:

A reference was created to embedded interop assembly c:\\Program Files (x86)\\Reference Assemblies\\Mic

相关标签:
1条回答
  • 2020-12-24 11:16

    Per the MSDN:

    "You have added a reference to an assembly (assembly1) that has the Embed Interop Types property set to True. This instructs the compiler to embed interop type information from that assembly. However, the compiler cannot embed interop type information from that assembly because another assembly that you have referenced (assembly2) also references that assembly (assembly1) and has the Embed Interop Types property set to False."

    To address this warning

    To embed interop type information for both assemblies, set the Embed Interop Types property on all references to assembly1 to True.

    This means you must change 'Embed Interop Types=true' on System.Windows.Forms.dll

    or

    To remove the warning, you can set the Embed Interop Types property of assembly1 to False. In this case, interop type information is provided by a primary interop assembly (PIA).

    0 讨论(0)
提交回复
热议问题