-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move CefSharp Dependencies to Subfolder #601
Comments
You could try calling http://msdn.microsoft.com/en-us/library/windows/desktop/ms686203%28v=vs.85%29.aspx |
@bjarteskogoy Did you resolve this? Can we close this issue? |
Adding this for my own reference, it maybe possible to use the |
Quick test and it appears that it works as advertised.
|
You'll also have to set the https://github.com/cefsharp/CefSharp/blob/cefsharp/47/CefSharp.Core/CefSettings.h#L29 |
Example using new // Copyright © 2010-2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using System;
using System.Runtime.CompilerServices;
using System.Windows.Forms;
namespace CefSharp.MinimalExample.WinForms
{
public class Program
{
[STAThread]
public static void Main()
{
var libraryLoader = new CefLibraryHandle(@"D:\projects\CefSharp.MinimalExample\libs\libcef.dll");
var isValid = libraryLoader.IsInvalid;
//Calls to CEF cannot be made directly in this method, doing so would
//attempt to load `CefSharp.Core` which requires `libcef.dll` which
//we are now dynamically loading from our own folder.
LoadForm();
libraryLoader.Dispose();
}
//Must make this this method isn't inlined otherwise it will
// dynamically load CefSharp.Core
[MethodImpl(MethodImplOptions.NoInlining)]
private static void LoadForm()
{
var settings = new CefSettings();
//Must specify these three paths
settings.BrowserSubprocessPath = @"D:\projects\CefSharp.MinimalExample\libs\CefSharp.BrowserSubprocess.exe";
settings.LocalesDirPath = @"D:\projects\CefSharp.MinimalExample\libs\locales";
settings.ResourcesDirPath = @"D:\projects\CefSharp.MinimalExample\libs";
//Must set performDependencyCheck: false
Cef.Initialize(settings, shutdownOnProcessExit: false, performDependencyCheck: false);
var browser = new BrowserForm();
Application.Run(browser);
}
}
}
|
You can copy paste |
With #1714 it should also be possible to modify the example |
Hi, I created a gist, where I used the AssemblyResolver method mentioned above to move the cefsharp files to a subfolder. You can find it here. When you compile it in debug mode nothing happens, but when you use release mode the AssemblyResolver does its magic and redirects all cefsharp dll requests to the designated subfolder. Right now I manually move the cefsharp files to the subfolder. Maybe there is a better solution, to do this automatically when compiling in release mode. |
I've never seen a problem with |
It does nothing on #if !DEBUG
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
#endif It uses the approach of #1714 |
I have no idea what the purpose of your comments is then? |
Sorry, I had my mind on another problem, which turned out not to be one. So i changed my gist to be more flexible.
So if you like a clean folder structure you move all cefsharp files to the |
@BlackBooth Ok, thanks for the example 👍 In general I'd recommend removing all unnecessary pieces of code when providing an example, like |
For future reference, I just followed your steps and did a quick tutorial on StackOverflow to (hopefully) make the steps a little easier to follow. |
@XanderLuciano Your example is unnessicarily complex, you don't need a When |
Is it possible to place libcef.dll in another folder than CefSharp.BrowserSubprocess.exe ?
The text was updated successfully, but these errors were encountered: