标签:专业 nts str 办公 调试运行 调试 ros ati and
webbrowser的诟病做开发的都知道,这次的发开项目中我就直接使用了CefSharp组件,过程也是一波三折,遇到很多问题,现在这块基本没什么问题了,过来做下记录。
1.下载地址:https://github.com/cefsharp/CefSharp/
2.之前一直用的vs2010,办公机器懒得折腾一直没装新版vs,无奈打不开这个程序,安装了vs2015 专业版
3.源码调试运行都很顺利
4.项目引用,开发环境基本也没什么大问题。
5.组件引用后,发现关闭程序时出现卡死,后来在FormClosed事件里各种资源释放还是无解,最后研究了下程序退出的各种方法,把Environment.Exit(0);换成Application.Exit();居然完美解决?! 还是不太懂原理,现在依然觉得好神奇。。。。有大神看到的话还请不吝指教~~
6.后来发布的时候的发现在别人的机器上无法运行,提示报错:
System.IO.FileNotFoundException: Could not load file or assembly ‘CefSharp.Core.dll‘ or one of its dependencies. 找不到指定的模块。
File name: ‘CefSharp.Core.dll‘
百度了一下,万幸找到官网帮助:
https://github.com/cefsharp/CefSharp/wiki/Frequently-asked-questions#Runtime_dependencies
引用第4个高频问题如下:
This is a common error, typically one of the following
CefSharp
includes unmanaged
dll‘s and resources, these are copied to the executing folder via two .props
file which are included in your project when you install the Nuget
packages. See list of required files below, make sure the required files are present.unmanaged
resources by default, you‘ll need to add them manually. For ClickOnce
, see #1314 for some pointers and solutions other users have come up with.A list of required files can be found here: Output files description (Redistribution)
NOTE: This also applies if you get a FileNotFoundException
when initializing the WPF
control in XAML
.
NOTE 2: If compiling from source (not recommended, use the Nuget
packages) and you notice that you can no longer build in debug mode, but release builds work just fine you may need to repair your version of Visual Studio. This happens in rare cases where you will get the same exact message as a missing unmanaged .dll file as shown above.
https://github.com/cefsharp/CefSharp/wiki/Output-files-description-table-(Redistribution)
For versions 43
and above you will need Visual C++ Redistributable Packages for Visual Studio 2013
For versions 41
and below you will need Visual C++ Redistributable for Visual Studio 2012 Update 4.
VC++
is distributed in both x86
and x64
variants, make sure you install the version matching your target architecture. (i.e. when targeting x86, x86 redistributable packages are needed).
标签:专业 nts str 办公 调试运行 调试 ros ati and
原文地址:http://www.cnblogs.com/AimeeFang/p/6088107.html