CefSharp on Windows XP / Server 2003 / VS 2010
Asked Answered
P

4

6

I am trying to integrate CefSharp in a C# project I am developing in Visual Studio 2010 on Windows XP. Similar errors have been reported by other people running Windows Server 2003.

  1. I add CefSharp.WinForms via NuGet and it seem to work great.

  2. I compile and run the app however when I try to load CefSharp I get "A procedure imported by 'CefSharp.Core.dll' could not be loaded."

Below is the code I run:

        var settings = new CefSharp.CefSettings {
            PackLoadingDisabled = true
        };

        if (Cef.Initialize(settings)) {
            throw new Exception("Failed to initialze CefSharp");
        }

        var browser = new CefSharp.WinForms.ChromiumWebBrowser("http://www.google.com/");
        browser.SetBounds(0, 0, ClientSize.Width, ClientSize.Height);
        Controls.Add(browser);

On the CefSharp FAQ It tells me that I should perform a number of tasks which I have done in order to run on Windows XP, even though XP is not officially supported it says in the FAQ that it works.

Error message that appears

Project files

Files in bin\x86\debug

Porch answered 23/1, 2015 at 9:36 Comment(2)
@albertjan No unfortunately not. I managed to get an older version of CefSharp to work. I am still interesting in a solution!Porch
I did :) but I couldn't get it to work with the nugets. I had to compile it myself to .net 4. And I had so specify the target platform toolset to 120 for the c++ project. (although I'm not really sure that was really nessecairy)Caponize
U
0

I think there's a typo/missing word in "Make sure the correct Visual C++ version is installed."

IMHO it should read: "Make sure the correct Visual C++ Redistributable version is installed."

It's a reference to another FAQ item: https://github.com/cefsharp/CefSharp/wiki/Frequently-asked-questions#Including_vcredist

Ulster answered 24/1, 2015 at 1:34 Comment(2)
I agree and that is actually how I read that requirement as well. The correct VC++ redistributable is installedPorch
Sounds like it's time to take Dependency Walker for a spin and compare with what you see on a non-XP machine with the same binaries. See github.com/cefsharp/CefSharp/issues/409Ulster
W
0

There's a couple of potential problems you should watch for too:

1 - set the browser subprocess path:

var settings = new CefSettings {
BrowserSubprocessPath = "CefSharp.BrowserSubprocess.exe"
}; 

2 - set the address/html NOT in your ctor but in the browser.IsBrowserInitialised event (and only after checking the browser is initialised) In short, CEF is BIG FAT dll which takes a while to load up and initialise... We will have this working in no time!

Wexler answered 25/1, 2015 at 12:38 Comment(1)
Unfortunately I cannot even execute new CefSettings so the error is much earlier, most likely in GAC bindings or something similar.Porch
E
0

Same issue here. REALLY REALLY annoying. I tried dependency walker and it did not give me any relevant information. All the tutorials are not giving relevant information. I'm pretty sure it's impossible, at least with the nuget package.

Elul answered 15/4, 2015 at 12:59 Comment(0)
D
0

I had problem solved that topic.

https://groups.google.com/forum/#!searchin/cefsharp/xp/cefsharp/J5gX7OKf7Rc/EoB3h0UmfYYJ

If you have VS2013 and some time, you could try building from source with a minor modifications.

  • Make sure you build in Release mode when deploying to XP/2003
  • Change the two c++ projects Platform Toolset to Visual Studio 2013 - Windows XP (v120_xp)
  • Make sure the machine your deploying to has VC++ 2013 Redist installed.
Dibrin answered 17/6, 2015 at 8:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.