This maybe a very silly question but it bothers me quite a while. When I tried to export Activeview of ArcMap to a PNG file using the "IExport" interface from Arcobjects C#. Visual Studio always pops out this error message:screenshot of the code
IExport export= new ESRI.ArcGIS.Output.ExportPNGClass();
Error: Interop type 'ESRI.ArcGIS.Output.ExportPNGClass' cannot be embedded. Use the applicable interface instead.
I am not sure why the "ExportPNGClass" cannot be embedded or why is "IExport" is not an applicable interface. The ESRI example is also using the same interface and coclass to export maps.
I am using ArcGIS 10.3.1 and Visual Studio 2012 with .Net framework 4.0. Following references were added in front of the code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.Office.Interop.Word;
using ESRI.ArcGIS.ArcMapUI;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.Display;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Output;
Any help would be appreciated!