关于C#调用DLL崩溃闪退报错的问题,如何解决?

最近正在学习做一个创建虚拟串口的窗体程序Demo,调用了DLL后,崩溃闪退。

以下是是方法类的代码

[DllImport("vspdctl.dll", CallingConvention = CallingConvention.StdCall)]
        public static extern bool CreatePair(string comName1, string comName2);

public bool CreatePort(string com1,string com2)//创建方法
        {
            string s = com1;
            string s2 = com2;
            bool IsCrateture=CreatePair(com1, com2);//创建
            return IsCrateture;
        }

窗口按钮调用的代码


```c#
 private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                bool IsCrateSeccuss = GetVSPD.CreatePort(CreatePortName.Text, CreatePortName2.Text);//是否创建成功
                if (IsCrateSeccuss)
                {
                    MessageBox.Show("创建成功");
                }
                else
                {
                    MessageBox.Show("失败");
                }
            }
            catch(Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            
            
            
        }

``

报了这个错误,错误如下:
System.DllNotFoundException:无法加载DLL"vspdctl.dll":动态链接库(DLL)初始化例程失败。(异常来自 HRESULT:0x8007045A)
在CreatePortDemo.VSPDclass.CreatePair(StringcomName1StringcomName2)在CreatePortDemo.VSPDclass.CreatePort(Stringcom1Stringcom2)位置F:1A\虚拟Demo\CreatePortDemoVSPDClas5.cs:行号32
在CreatePortDemo.CreatePortForm.button1 click(Object senderEventArgs e)位置F:1A\虚拟DemoCreatePortDemoCreatePortForm.cs:行号30

请求老哥们帮助!该怎么解决这个问题!

已经解决了。