English

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

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

  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.

Related Information

Last Published: 2/4/2020

Article ID: 000022628

Software: ArcGIS Pro 2.5