HOW TO

Fix compiler error(s) using CefSharp and the ArcGIS Pro SDK ChromiumWebBrowser Control in an add-in

Last Published: September 12, 2023

Summary

After adding references to ArcGIS Pro’s CefSharp assemblies to an add-in and adding a reference to the ArcGIS Pro ChromiumWebBrowser control to the add-in UI xaml, for example, on a pane or dockpane, as shown in the following image, a compiler error is returned stating that the ChromiumWebBrowser control cannot be found in the ArcGIS.Desktop.Framework.Controls namespace in the ArcGIS.Desktop.Framework assembly.

image of added references
image of compiler error
Moreover, additional warning messages may also be returned, and the UI xaml can no longer be viewed in the Visual Studio Designer, as shown below.
image of Visual Studio Designer error

Procedure

When using CefSharp, to resolve the compiler issue with the Visual Studio designer, the add-in platform target must be set to x64, as follows.

  1. Open the Visual Studio Configuration Manager.
image of Visual Studio Configuration Manager
  1. Select <New…> from the Active solution platform list box.
image of configuration manager
  1. From the New Solution Platform dialog box, select x64 and click OK.
image of the New Solution Platform dialog box
  1. Make sure that the Active solution platform and Platform list boxes both show x64 as shown in the image below, and click Close.
image of configuration manager
  1. Re-build the add-in.
Note:
If your control constructor InitializeComponent() call (within your user control .xaml.cs code behind file) throws a System.Windows.Markup.XamlParseException with an inner exception: “FileNotFoundException: CefSettings BrowserSubprocessPath not found.” check the Copy Local setting on your CefSharp assembly references. Copy Local must be set to false.
image of exception

Please consult ProConcepts Framework, ChromiumWebBrowser for more information.

Article ID:000022628

Software:
  • ArcGIS Pro 2 x

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic