1

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!

TTTZ
  • 11
  • 1
  • I assume the setting `Embed Interop Type` for the assembly which contains the namespace `Microsoft.Office.Interop.Word` is set to true. Try setting it to false. – NtFreX Jul 24 '17 at 22:21
  • see [https://stackoverflow.com/a/4553402/2592875](https://stackoverflow.com/a/4553402/2592875) for a similar issue. – TnTinMn Jul 24 '17 at 22:52
  • 2
    Possible duplicate of [Interop type cannot be embedded](https://stackoverflow.com/questions/2483659/interop-type-cannot-be-embedded) – Jasper Schellingerhout Jul 24 '17 at 23:46
  • @NtFreX, Thx! That solves my issue! – TTTZ Jul 25 '17 at 13:11
  • @ Jasper Schellingerhout, yes, very similar. Only contribution might be: need to check ALL Interop settings. – TTTZ Jul 25 '17 at 13:14

0 Answers0