Hello amaitland thanks sorry for longer answer.
PS: I am sorry I really want fix your github because From my Visual Studio 2017 shows error line "toolStripContainer". Please replace to this.Controls:Add(browser); Please believe me! I don't joke you. I show proof.
- Code: Select all
using System.Windows.Forms;
using CefSharp;
using CefSharp.WinForms;
namespace EmbedTest
{
public partial class BrowserForm : Form
{
private readonly ChromiumWebBrowser browser;
private CefSettings settings;
public BrowserForm()
{
InitializeComponent();
settings = new CefSettings();
settings.CefCommandLineArgs.Add("enable-npapi", "1");
Cef.Initialize(settings);
//browser = new ChromiumWebBrowser("https://www.adobe.com/de/software/flash/about/")
browser = new ChromiumWebBrowser("chrome://plugins/")
{
Dock = DockStyle.Fill,
};
this.Controls.Add(browser);
}
}
}
And compiler doesn't show any errors That is why "toolStripContainer" is unknown method. Why do you not like my improvement? I am trying to explain to you.
Do you know how do I embed all dlls, dat and bin into exe?
But CefSharp libraries need local because program starts unexpected - I check task manager. my own browser crashes because it need CefSharp libraries.
Make sure CefSharp libraries stay local disk.
And thrid party plugins should embed - If you want dlls into local disk for next version for plugins.
- Code: Select all
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AsemblyResolver); // It is event to read from embedded dlls, dats and bins
Application.Run(new BrowserForm());
}
And example likes this:
- Code: Select all
static Assembly CurrentDomain_AsemblyResolver(object sender, ResolveEventArgs args)
{
// NPSWF32.dll ( NPAPI Flash Player )
using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("EmbedTest.NPSWF32.dll"))
{
byte[] assemblyData = new byte[stream.Length];
stream.Read(assemblyData, 0, assemblyData.Length);
return Assembly.Load(assemblyData);
}
// add more stream1, stream2, .....
{
Make sure all embedded files into "Embedded Resource"
And build it. and go to x64 or x86 directory and debug or release than remove copied dlls from embedded resources example libcef.dll was embedded in exe and local disk should remove and check if application shows - yay we don't need to get required libraries in root directory of application. PS: chrome://plugins looks like it doesn't know where is libcef.dll If my application embeds important dlls in executable's data. Why does it happen because chrome://plugins shows path to libcef.dll But it didn't hold if libraries not local disk. Does it anybody fix?
Example:
Photo I am sorry that it is very big because my monitor has 27 inch.
Thanks