问题
As the headline suggests, what I'm trying to do is to embed a Cefsharp Chromium browser in a VSTO Custom Task Pane (CTP) for Excel.
I have tested the Cefsharp browser in a standard Windows form and it works beautifully. And I'm using this code for the CTP, and that also works without problems.
The problem arise when I try to combine them. Then I get an 'System.IO.FileNotFoundException' error stating that 'CefSharp.Core.DLL' could not be read.
My CTP startup-function loos like this:
Private taskPaneControl1 As TaskPaneControl
Private WithEvents taskPanaValue As CustomTaskPane
Private Sub ThisAddIn_Startup() Handles Me.Startup
taskPaneControl1 = New TaskPaneControl()
taskPanaValue = Me.CustomTaskPanes.Add(taskPaneControl1, "TEST")
taskPanaValue.Width = 650
End Sub
...and it works as fine as long as I just have an 'empty' constructor in TaskPaneControl:
Public Class TaskPaneControl
Private WithEvents browser As ChromiumWebBrowser, chrome_popup As ChromiumWebBrowser
Private proc As New Process
Public Sub New()
' This call is required by the designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
'Dim settings As New CefSettings
End Sub
End Class
...but when I un-comment "Dim settings As New CefSettings" in the bottom of the constructor I get the 'System.IO.FileNotFoundException'-error mentioned above.
Cefsharp is installed via Nuget Package Manager and all references are correctly set.
I don't understan why it's not working?!
Setup:
- Windows 10 64-bit
- Excel 2016 32-bit
- VS 2015
- Cefsharp 57.0
来源:https://stackoverflow.com/questions/48630473/embed-cefsharp-browser-in-custom-task-pane-for-excel