1

This is driving me demented so hope someone can help!

I have developed a small application in C# that uses the CefSharp (Chromium) component. This application runs fine on any PC where VS2015 is installed however it crashes immediately without warning or exception dialog on a non-development machine.

The solution is built for x86 and the issue occurs with a Release or a Debug version of the application.

I have used the Assembly Binding Log Viewer (Fuslogvw.exe) program however it does not report any errors with my bindings - all reports say OK.

Windows error log:

Application: Launcher.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.IO.FileNotFoundException Stack: at Launcher.Program.Main()

Can anyone advise on what I can do to try and identify this issue?

Edit: Directory listing of install location on non-development PC.

16/12/2015  00:28           440,320 Launcher.exe
12/12/2015  10:59             1,688 Launcher.exe.config
16/12/2015  00:28            77,312 Launcher.pdb
16/12/2015  00:28            22,696 Launcher.vshost.exe
12/12/2015  10:59             1,688 Launcher.vshost.exe.config
30/10/2015  07:19               490 Launcher.vshost.exe.manifest
12/12/2015  10:55         2,197,289 cef.pak
12/12/2015  10:55           647,680 CefSharp.BrowserSubprocess.Core.dll
12/12/2015  10:55            11,264 CefSharp.BrowserSubprocess.exe
12/12/2015  10:55           974,336 CefSharp.Core.dll
12/12/2015  10:55            28,004 CefSharp.Core.xml
12/12/2015  10:55           139,776 CefSharp.dll
12/12/2015  10:55            23,040 CefSharp.WinForms.dll
12/12/2015  10:55             4,223 CefSharp.WinForms.xml
12/12/2015  10:55           230,962 CefSharp.xml
12/12/2015  10:55           296,406 cef_100_percent.pak
12/12/2015  10:55           403,210 cef_200_percent.pak
12/12/2015  10:55         3,873,562 cef_extensions.pak
11/12/2015  22:50             5,040 cloud.png
12/12/2015  10:55         2,106,216 d3dcompiler_43.dll
12/12/2015  10:55         3,466,856 d3dcompiler_47.dll
13/12/2015  00:34             5,976 debug.log
12/12/2015  10:55         4,405,316 devtools_resources.pak
12/12/2015  10:55        10,206,624 icudtl.dat
11/12/2015  22:50             2,051 launch.html
12/12/2015  10:55        50,612,224 libcef.dll
12/12/2015  10:55            75,264 libEGL.dll
12/12/2015  10:55         1,874,944 libGLESv2.dll
16/12/2015  22:13                 0 list.txt
16/12/2015  00:30    <DIR>          locales
12/12/2015  10:55           410,979 natives_blob.bin
11/12/2015  22:50           129,382 output.ico
11/12/2015  22:50            26,554 portal.png
16/12/2015  08:18           543,928 procdump.exe
15/12/2015  23:03             2,732 relnotes.txt
12/12/2015  10:55           463,528 snapshot_blob.bin
16/12/2015  00:30            22,952 unins000.dat
16/12/2015  00:30         1,197,891 unins000.exe
12/12/2015  10:55           202,240 widevinecdmadapter.dll
PiotrWolkowski
  • 8,408
  • 6
  • 48
  • 68
tip2tail
  • 463
  • 1
  • 6
  • 23
  • 2
    Are you sure you included the CefSharp dll files that are probably necessary for your executor to work on a machine without those files ? – Orel Eraki Dec 16 '15 at 22:12
  • Hi yes I have ensured the DLLs are all set to CopyLocal etc. I will edit the question with a directory listing. – tip2tail Dec 16 '15 at 22:16
  • 1
    Use Process Monitor from Sysinternals in order to monitor the file activity of your application. You will see which files the app tries to access and whether the access was successful or not. – Olivier Jacot-Descombes Dec 16 '15 at 22:32
  • 2
    Your likely missing `VC++ Redist` see http://stackoverflow.com/a/32320761/4583726 for a slightly more detailed answer. Check https://github.com/cefsharp/CefSharp#release-branches to see which version you require based on `CefSharp` version. – amaitland Dec 16 '15 at 23:20
  • If you distribute your `App` via an installer, then http://stackoverflow.com/a/34015902/4583726 will also be relevant. – amaitland Dec 16 '15 at 23:23
  • @OlivierJacot-Descombes If you add your comment as an answer I will accept it! Thank you! Process Monitor was exactly what was needed. – tip2tail Dec 16 '15 at 23:26
  • 2
    @amaitland I came back after dealing with the Process Monitor application and using it identified you are exactly right - I was missing the VC++ 2013 re-distributable package. I have also since found a way to deploy it without the installer as I need to have this installed to machines without admin rights. Thank You! – tip2tail Dec 16 '15 at 23:28

3 Answers3

4

Use Process Monitor from Windows Sysinternals (part of Microsoft TechNet) in order to monitor the file activity of your application.

You will notice that an immense amount of events are logged. Most of them regarding accesses to the registry. But fortunately you can install different kinds of filters. If you know the name of the process you want to analyze, filter by process name.

You will see which files the app tries to access and whether the access was successful or not.

Olivier Jacot-Descombes
  • 104,806
  • 13
  • 138
  • 188
1

The process was terminated due to an unhandled exception. Exception Info: System.IO.FileNotFoundException

If you get this error, ensure you have Visual C++ 2012/2013 Redistributable installed.

http://www.codeproject.com/Articles/1058700/Embedding-Chrome-in-your-Csharp-App-using-CefSharp

Fayyaz Ali
  • 787
  • 1
  • 8
  • 18
0

Are you referencing a file that the non-development machine can't find? Is the file access happening in your own code or in the CefSharp component?

Try putting in a file.exists check before the code for the target file and log that result

Sorry if this is something you've already tried though.

Jim
  • 117
  • 1
  • 14
  • Hi Jim. My code is exiting immediately I run it on the non-dev machine. I cannot add a File.Exists as I'm not trying to open a file that I know of. If I could identify the file the program is trying to open then I would be some way to fixing this. Thanks! :) – tip2tail Dec 16 '15 at 22:23
  • Can you check the event log? It might tell you if it's unable to find or load a particular flie. – Jim Dec 17 '15 at 22:09
  • I had the same problem and then I downloaded Visual C++ Redistributable for Visual Studio 2017 .... it worked! – Melad Aug 28 '18 at 05:41