Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

450
Visualizações
How do you use CefSharp in a WCF Service?

I am trying to use the CefSharp.OffScreen(41.0.0) Nuget Package within a WCF Service Application, and I'm getting the following error while trying to run the service from Visual Studio 2013:

Could not load file or assembly 'CefSharp.BrowserSubprocess.Core.DLL' or one of its dependencies. The specified module could not be found.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'CefSharp.BrowserSubprocess.Core.DLL' or one of its dependencies. The specified module could not be found.

The mentioned assembly is present in the project's bin folder as well as all the required assemblies listed on CefSharp's Website. If there is in fact another assembly required I haven't figured out what it is.

A few other points worth mentioning:

  • It is easy to reproduce: Start with VS2013's "WCF Service Application" template simply added the CefSharp.Offscreen Nuget Package.
  • I build the project in x86.
  • CefSharp also depends on the Visual Studio C++ 2012 redistributables. I copied those file into the bin folder but still get the same error.
  • I tried the solutions in the SO question here, to no avail.
  • CefSharp works fine when referenced from a Console Application or WPF Application.
over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

Few points,

IIS cannot access Desktop

So you can't run anything that needs a desktop. Your Console and WPF application has access to Desktop and are called user interactive processes.

CEF needs desktop

Cef will need Window manager to create window, without which it cannot render page. This is the reason, the error is misleading here, as IIS cannot load dependent assemblies which require Desktop interaction unless Allow service to interact with Desktop is selected for IIS process in Windows Services.

Console application is only option with Login

You will have to run your application as console and you will need to login to desktop, allowing IIS to interact with desktop is not a good option and I don't even know what kind of problems it might have.

You can set your server to auto login to some user by modifying registry and set your console application in your startup. So this way everytime server will be restarted, your server will automatically login to specified user and your console app will start. (Windows 8.1 has little difficulty but you will get some solution).

Custom Windows Service with Desktop Access

You can change your application type to Windows Service instead of Console and you can install your windows service that allows access to desktop shown in this article, beware, there are problems that this will work only if somebody is logged on to server.

http://www.codeproject.com/Articles/4891/Interact-With-Desktop-when-Installing-Windows-Serv

PhantomJS headless browser

There is PhantomJS headless browser which you can run in IIS/Windows Service without need to interact with desktop, however you will need to shift your code to JavaScript instead of C#. There are other libraries to manage PhantomJS from your app as well.

over 4 years ago · Santiago Trujillo Relatório

0

According to this link it appears that the solution to this problem is to run the CefSharp code in a [STAThread] thread.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda