LightningChart部署到Windows11某些电脑,无法启动问题

      问题经过注册表排查、SDK排查,均没有解决问题。

      在可以运行的电脑上,全盘搜索LightningChat、Arction(厂家名称)比对,终于发现一个temp目录下的Arction.DirectX_32目录以及下边俩个dll:D3DCompiler_43.dll、d3dx11_43.dll,删除了就启动不了。

      解决方案就是增加文件监测,完美解决:

     

复制代码
        /// <summary>
        ///检查Arction.DirectX_32文件是否存在
        /// </summary>
        private void CheckDllFile()
        {
            try
            {
                string currentPath = System.AppDomain.CurrentDomain.BaseDirectory;
                string localAppDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
                string directoryPath = Path.Combine(localAppDataPath, @"Temp\Arction.DirectX_32");
                //if (!Directory.Exists(directoryPath))
                {
                    Directory.CreateDirectory(directoryPath);
                    string filePath = directoryPath + @"\D3DCompiler_43.dll";
                    string filePath2 = directoryPath + @"\d3dx11_43.dll";
                    if (!File.Exists(filePath))
                    {
                        File.Copy(currentPath + @"D3DCompiler_43.dll", filePath);
                    }
                    if (!File.Exists(filePath2))
                    {
                        File.Copy(currentPath + @"d3dx11_43.dll", filePath2);
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
复制代码

 

posted @   治十三  阅读(13)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 通过 API 将Deepseek响应流式内容输出到前端
· AI Agent开发,如何调用三方的API Function,是通过提示词来发起调用的吗
点击右上角即可分享
微信分享提示