問題經過登錄檔排查、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) { } }