首页 > 解决方案 > 将文件移动到另一个文件夹但被视为丢失

问题描述

我似乎在移动一些文件夹和文件时遇到问题,我正在使用cefSharp库,我最初使用的是PrettyBinfrom nugent,这对其他 .dll 文件做得很好,我想我也会将 cef 文件移动到lib文件夹中,只是为了保持一切。

我做了什么:

程序.cs

using CefSharp;
using System;
using System.IO;
using System.Windows.Forms;

namespace rankjester
{
    internal static class Program
    {
        private static string lib, browser, locales, res;
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        private static void Main()
        {
            lib = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"lib\cef\libcef.dll");
            browser = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"lib\cef\CefSharp.BrowserSubprocess.exe");
            locales = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"lib\cef\locales\");
            res = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"lib\cef\");
            var libraryLoader = new CefLibraryHandle(lib);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new FormMain());
        }
    }
}

lib路径都很好并且匹配,但是当我运行软件时,我得到:

System.IO.FileNotFoundException: 'Could not load file or assembly 'CefSharp, Version=86.0.241.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138' or one of its dependencies. The system cannot find the file specified.'

如果我将这些行注释掉,然后按应有的方式加载,我有什么遗漏的吗?

我还注意到每次运行调试时cefSharp都会创建x86和文件夹,有没有办法可以关闭它?x64任何帮助,将不胜感激。

标签: c#cefsharp

解决方案


推荐阅读