C# 其实已经引用了,但打包后无法加载到Dll

1、可能你得dll引用得路径不对

2、你打包得dll下也有当前得dll,但是无法关联,这个时候可以在代码里进行重新反射加载dll,使得与之进行绑定

            string filename = Path.GetDirectoryName(
                 System.Reflection.Assembly
                   .GetExecutingAssembly().Location); 
            string filename4 = Path.Combine(filename, "BGYFunctionTool.dll");
            if (File.Exists(filename4))
            {
                System.Reflection.Assembly
                 .LoadFrom(filename4);
            }

发布了7 篇原创文章 · 获赞 0 · 访问量 8760

猜你喜欢

转载自blog.csdn.net/weixin_31026691/article/details/104951671