Hey everyone, I really like the work that's happening with CefSharp and I am trying to use it within my application. I can build and run both the CefSharp.MinimalExample and the CefSharp.WpfExample and they are working flawlessly with no issues (I did have to run nuget restore but that was expected) (Also had to force x86 building).
I have used nuget "Install-Package CefSharp.Wpf -Pre" to install the packages and then used the code from CefSharp.MinimalExample to add a WebView into my application.
I have tried getting this to work for a while now, by reading this group and everything else I can find but I'm still not having any success. I got to the point where when my application loads it throws a System.AccessViolationException from within CefSharp.Core.dll.
Just so that we are on the same page and can hopefully figure out where it is I've gone wrong, I'll start from the beginning and provide the exact steps I am taking.
Step 1:
PM> Install-Package CefSharp.Wpf -Pre
Attempting to resolve dependency 'CefSharp.Common (= 31.0.0-pre1)'.
Attempting to resolve dependency 'cef.redist (≥ 3.1650.1562-pre3 && < 3.1651)'.
Installing 'cef.redist 3.1650.1562-pre3'.
Successfully installed 'cef.redist 3.1650.1562-pre3'.
Installing 'CefSharp.Common 31.0.0-pre1'.
Successfully installed 'CefSharp.Common 31.0.0-pre1'.
Installing 'CefSharp.Wpf 31.0.0-pre1'.
Successfully installed 'CefSharp.Wpf 31.0.0-pre1'.
Adding 'cef.redist 3.1650.1562-pre3' to AppView.
Successfully added 'cef.redist 3.1650.1562-pre3' to AppView.
Adding 'CefSharp.Common 31.0.0-pre1' to AppView.
Successfully added 'CefSharp.Common 31.0.0-pre1' to AppView.
Adding 'CefSharp.Wpf 31.0.0-pre1' to AppView.
Successfully added 'CefSharp.Wpf 31.0.0-pre1' to AppView.
Then I have made classes based on the CefSharp.MinimalExample PropertyChangedExtensionMethods and MainViewModel
And this is the output folder with all of the files. The first time I tried I didn't have CefSharp.Core.dll and that was a problem.
at CefSharp.Internals.ClientAdapter.GetCefBrowser(ClientAdapter* , CefRefPtr<CefBrowser>* )
at CefSharp.Internals.RenderClientAdapter.TryGetCefMainFrame(RenderClientAdapter* , CefRefPtr<CefFrame>* )
at CefSharp.ManagedCefBrowserAdapter.LoadUrl(String address)
at CefSharp.Wpf.WebView.OnAddressChanged(String oldValue, String newValue)
at CefSharp.Wpf.WebView.OnAddressChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at System.Windows.Baml2006.WpfMemberInvoker.SetValue(Object instance, Object value)
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(XamlMember member, Object obj, Object value)
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)
at System.Xaml.XamlObjectWriter.Logic_ApplyPropertyValue(ObjectWriterContext ctx, XamlMember prop, Object value, Boolean onParent)
at System.Xaml.XamlObjectWriter.Logic_DoAssignmentToParentProperty(ObjectWriterContext ctx)
at System.Xaml.XamlObjectWriter.WriteEndMember()
at System.Xaml.XamlWriter.WriteNode(XamlReader reader)
at System.Windows.Markup.WpfXamlLoader.TransformNodes(XamlReader xamlReader, XamlObjectWriter xamlWriter, Boolean onlyLoadOneNode, Boolean skipJournaledProperties, Boolean shouldPassLineNumberInfo, IXamlLineInfo xamlLineInfo, IXamlLineInfoConsumer xamlLineInfoConsumer, XamlContextStack`1 stack, IStyleConnector styleConnector)
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
at NetUML.View.UserControls.ModellingPane.InitializeComponent()
in c:\\Users\\Clayton Johnson\\Documents\\Programming\\netuml\\NetUML\\NetUML\\View\\UserControls\\ModellingPane.xaml:line 1
at NetUML.View.UserControls.ModellingPane..ctor()
in c:\\Users\\Clayton Johnson\\Documents\\Programming\\netuml\\NetUML\\NetUML\\View\\UserControls\\ModellingPane.xaml.cs:line 21
So that was pretty long and I greatly appreciate anyone who takes the times to read this and provide me with any advice that can help me get this working because I really want to use CefSharp in my application but I just can't get it to work.
On another note, occasionally and I mean very occasionally it will load but nothing will display on the page.