首页 > 解决方案 > 任何帮助!错误系统 IO 文件未找到异常

问题描述

当我运行这个程序时,我已经修复了这个错误。任何帮助!

错误 System.IO.FileNotFoundException:'无法加载文件或程序集'System.Configuration.ConfigurationManager,版本 = 4.0.3.0,文化 = 中性,PublicKeyToken = cc7b13ffcd2ddd51'。该系统找不到指定的文件。'

class Program
{        
    static void Main(string[] args)
    {                                    
        Console.WriteLine("Hello World!");
        Bluetooth bluetooth = new Bluetooth();
        bluetooth.startScan();
    }
    
    class Bluetooth
    {
        Guid mUUID = new Guid("00001101-0000-1000-8000-00805F9B34FB");
        List<string> items = new List<string>();
        BluetoothDeviceInfo[] devices;
        public void startScan()
        {             
            Thread bluetoothScanThread = new Thread(new ThreadStart(scan));
            bluetoothScanThread.Start();
        }
        public void scan()
        {
            Console.WriteLine("Start scanning...");
            BluetoothClient client = new BluetoothClient();
            devices = client.DiscoverDevicesInRange();
            Console.WriteLine(devices.Length.ToString() + " devices discovered");
            Console.WriteLine("Scan complete");                
        }
    }

标签: c#bluetooth

解决方案


You might be missing the dll. Try installing this from Nuget

System.Configuration.ConfigurationManager

推荐阅读