反映也是项目类型冲突一部分的DLL

发布于 2025-01-02 21:53:17 字数 422 浏览 1 评论 0原文

我目前遇到了类型冲突。我有两个项目,A 和 B。A 有 B 作为依赖项。当 A 运行时,它运行一个 OpenFileDialog 并加载给定的程序集

var assembly = Assembly.ReflectionOnlyLoadFrom(selectedPath);

然后,稍后在我的代码中,我的类型发生冲突。我选择调用一个反射函数,因为

var result = WindowData.SelectedFunction.Invoke(null, parameters);

它是一个静态函数,因此我不会为第一个参数传递对象。显然第二组是参数的object[]。

因此,引用的程序集和我(实际上不是?)加载的程序集似乎发生了冲突。这很奇怪,因为这不会在手表的调试模式下发生。

I'm currently running into a type clash. I have two projects, A and B. A has B as a dependency. When A runs, it runs an OpenFileDialog and loads the given assembly with

var assembly = Assembly.ReflectionOnlyLoadFrom(selectedPath);

Then, later in my code, I'm having my types clash. I have a reflected function I chose to invoke as so

var result = WindowData.SelectedFunction.Invoke(null, parameters);

It's a static function, so I don't pass in an object for the first parameter. Obviously the second set is an object[] of the parameters.

So it seems the referenced assembly and the one I'm (not actually?) loading are colliding. It's weird because this DOES NOT happen in debug mode in a watch.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文