I am including Olectra Chart, a third-party graphics package, into a VB.Net project, but am plagued with the following warnings:-
vbc : warning BC40059: A reference was created to embedded interop assembly 'Interop.OlectraChart2D' because of an indirect reference to that assembly from assembly 'AxInterop.OlectraChart2D'. Consider changing the 'Embed Interop Types' property on either assembly.
vbc : warning BC40059: A reference was created to embedded interop assembly 'Interop.OlectraChart2D' because of an indirect reference to that assembly from assembly 'MyClassLibrary'. Consider changing the 'Embed Interop Types' property on either assembly.
These appear to prevent the necessary dlls from being included in the bin
directory, resulting in exceptions at run-time.
Edit: Exception thus:-
System.IO.FileNotFoundException: Could not load file or assembly 'Interop.OlectraChart2D, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. File name: 'Interop.OlectraChart2D, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null'
I have noted the answers given here and here, and have tried all possible combinations of Embed Interop Types
values in the property panel for AxInterop.OlectraChart2D
and Interop.OlectraChart2D
but none of them clears the warnings without creating compilation errors.
Including the project in a different solution brings different warnings:-
COM Reference 'OlectraChart2D' is the interop assembly for ActiveX control 'AxOlectraChart2D' but was marked to be linked by the compiler with the /link flag. This COM reference will be treated as a reference and will not be linked.
but the output bin
directory is fine.
I can clear the run-time exception by copying the dlls into the bin
directory from other solutions but that doesn't seem right to me. Does anyone know what I should do to fix this properly?