简体   繁体   English

应用程序立即崩溃,并带有FileNotFoundException

[英]Application crashes immediately with FileNotFoundException

This is driving me demented so hope someone can help! 这让我发疯,所以希望有人能帮忙!

I have developed a small application in C# that uses the CefSharp (Chromium) component. 我已经在C#中开发了一个使用CefSharp(铬)组件的小型应用程序。 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. 此应用程序可在安装了VS2015的任何PC上正常运行,但是会立即崩溃,而不会在非开发计算机上发出警告或异常对话框。

The solution is built for x86 and the issue occurs with a Release or a Debug version of the application. 该解决方案是为x86构建的,该问题与应用程序的发行版或调试版有关。

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. 我已经使用了Assembly Binding Log Viewer (Fuslogvw.exe)程序,但是该程序未报告与我的绑定有关的任何错误-所有报告都说确定。

Windows error log: Windows错误日志:

Application: Launcher.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. 应用程序:Launcher.exe框架版本:v4.0.30319说明:该进程由于未处理的异常而终止。 Exception Info: System.IO.FileNotFoundException Stack: at Launcher.Program.Main() 异常信息:System.IO.FileNotFoundException堆栈:在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. 编辑:非开发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

Use Process Monitor from Windows Sysinternals (part of Microsoft TechNet) in order to monitor the file activity of your application. 使用Windows Sysinternals (Microsoft TechNet的一部分)中的Process Monitor来监视应用程序的文件活动。

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. 您将看到该应用尝试访问哪些文件,以及访问是否成功。

The process was terminated due to an unhandled exception. 进程由于未处理的异常而终止。 Exception Info: System.IO.FileNotFoundException 异常信息:System.IO.FileNotFoundException

If you get this error, ensure you have Visual C++ 2012/2013 Redistributable installed. 如果出现此错误,请确保已安装Visual C ++ 2012/2013 Redistributable。

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

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? 文件访问是在您自己的代码中还是在CefSharp组件中进行的?

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. 抱歉,如果您已经尝试过此操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我的应用程序崩溃与FileNotFoundException,我不明白为什么 - My application crashes with a FileNotFoundException, and I don't understand why 启动后,C#.NET应用程序立即崩溃 - C# .NET Application Crashes Immediately After Starting c# .NET 应用程序在 3 台机器中的 1 台机器上启动时崩溃,出现 System.IO.FileNotFoundException - c# .NET application crashes on startup on 1 of 3 machines with System.IO.FileNotFoundException DotNet Console应用程序崩溃,并显示消息“ FileNotFoundException”。 虽然dll存在并且正在加载 - DotNet Console application crashes with a message “FileNotFoundException”. Though the dll is present and getting loaded 启动应用程序时有时会出现FileNotFoundException - FileNotFoundException sometimes when launching application 程序启动后几乎立即崩溃 - Program crashes almost immediately after starting 应用程序启动后出现System.IO.FileNotFoundException - System.IO.FileNotFoundException after start of application 在 .NET Core 应用程序中引用 DLL 时出现 FileNotFoundException - FileNotFoundException when referencing DLL in .NET Core Application WPF 应用程序立即为用户关闭 - WPF application immediately closes for user 应用程序启动中的OpenFileDialog立即关闭 - OpenFileDialog in Application Startup closing immediately
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM