Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The name ChromiumWebBrowser does not exist in the namespace "clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf"

I had followed this link to implement CefSharp applicaton.

But I have stuck while coding MainWindow.xaml.

Blend for VS 2015 said,

The name ChromiumWebBrowser does not exist in the namespace "clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf"

But I'm installed CefSharp.Common and CefSharp.Wpf v51.0.0, cef.redist.x64 and cef.redist.x86 v3.2704.1432 with NuGet Package Manager.

I'm new on developing C# so I don't know how to solve this problem. Please help me to solve this error.

This is my MainWindow.xaml

<Window x:Class="StocktalkBrowser.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:StocktalkBrowser"
        xmlns:cefSharp="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf"
        mc:Ignorable="d"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <cefSharp:ChromiumWebBrowser Grid.Row="0"  Address="https://github.com/cefsharp/CefSharp/wiki/Frequently-asked-questions" />
    </Grid>
</Window>

like image 352
Minkyu Kim Avatar asked Sep 21 '16 09:09

Minkyu Kim


2 Answers

I just tried the link, and as I mentioned in the comments it compiles without any problem.

It is shown as error,  but you can ignore it Can be ignored.

No Preview available And the preview is not available as well, I learned to live with it.

Compiles No errors when compiling

Program starts And the program starts up. No problem

like image 82
Nawed Nabi Zada Avatar answered Nov 17 '22 19:11

Nawed Nabi Zada


For me the problem was that the solution platform was set to AnyCPU.
As far as I know, CefSharp does not support AnyCPU. Interestingly the solution ran just fine in Release mode, but in Debug mode I immediately got an error - the invocation of the constructor on type that matches ... the specified binding constraints threw an exception.

As soon as I changed the solution platform to be only x64, then the XAML error went away (The name ChromiumWebBrowser does not exist in the namespace “clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf”). And I could run the solution both in Debug and Release mode.

like image 2
Marko Avatar answered Nov 17 '22 19:11

Marko