当前位置:编程学习 > C#/ASP.NET >>

求助:出现了无法加载 “DLL../bind/DllMath.dll”: 找不到指定的模块.(异常来自 HRESULT:0x8007007E)的错误,怎么解决?

TestCSharp中的代码如下:
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace TestCSharp
{
    public partial class Form1 : Form
    {
        [DllImport("../bind/DllMath.dll")]
        public static extern int add(int a, int b);

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            int c = add(23, 34);

            MessageBox.Show(c.ToString());
        }
    }
}

在DllMath.dll中只是简单的add函数的加法实现,并且我将TestCSharp.exe文件与DllMath.dll的输出路径到了同一文件夹下,我实在不明白,我究竟是拿错了,出现了“无法加载 DLL“../bind/DllMath.dll”: 找不到指定的模块.(异常来自 HRESULT:0x8007007E)的错误”
请求高人指点!
补充:.NET技术 ,  非技术区
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,