C#+ DLL依赖问题 [英] C# + DLL dependency issue

查看:273
本文介绍了C#+ DLL依赖问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿所有,

这有点奇怪,所以我会尽力解释它。

我有1个dll包含wpf用户控件的第三方库(Bag o tricks)。在我的框架dll中,我添加了这个dll并引用它。然后我创建了自己的组件,扩展了第三方库中的一个组件。到目前为止一直很好。


现在,如果其他人依赖我的项目,并且他们尝试使用我提供的组件(扩展第三方组件),则会抛出以下错误:


''无法解析对程序集的依赖''J832.Wpf.BagOTricksLib,Version = 0.0.0.0,Culture = neutral,PublicKeyToken = null''因为它尚未预加载。使用ReflectionOnly API时,必须通过ReflectionOnlyAssemblyResolve事件按需预加载或加载相关的程序集。


我有什么问题吗?我想如果他们使用我的控件,那个控件应该加载了dll并且应该知道如何使用它?


任何想法都会非常感激。

干杯,

Hey all,
This is a bit of a weird one, so I''ll try and explain it best I can.
I have 1 dll that contains a third party library of wpf user controls (Bag o tricks). In my framework dll, I added this dll and reference it. I then made my own component that extends one of the components in the third party library. So far so good.

Now if someone else depends on my project, and they try and use the component I offer (that extends the third party component), the following error is thrown:

''Cannot resolve dependency to assembly ''J832.Wpf.BagOTricksLib, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.

Is there something I am doing wrong? I figure that if they use my control, that control should have loaded the dll and should know how to use it?

Any ideas would be much appreciated.

Cheers,

推荐答案

这是一个同一系统上的项目吗?如果它是一个不同的系统,你是否暴露/转移了你需要的所有正确的.DLL?
Is this a project on the same system? If it''s a different system, are you exposing/transfering all the correct .DLLs you will need?



这是一个项目吗?同一系统?如果它是一个不同的系统,你是否暴露/转移所需的所有正确的.DLL?
Is this a project on the same system? If it''s a different system, are you exposing/transfering all the correct .DLLs you will need?



嗯,你能更具体一点吗? Bag O Tricks库存在于我的模块中,A。


模块B,取决于A,并在发生错误时尝试使用A中的某些东西。这是在VS中运行时。

在生产模块A中包含Bag O Tricks库,因此它们将位于同一系统上,但模块B可能不在。模块B将下载到客户端计算机(通过clickOnce将具有A)。如何或者我需要做什么才能公开.DLL'?

Hmm can you be more specific? The Bag O Tricks library exists within my module, A.

Module B, depends on A, and tries to use something from A when the error occurs. This is when running in VS.

In production module A contains the Bag O Tricks library, so they will be on the same system, but Module B might not be. Module B would get downloaded to the client machine (which would have A via clickOnce). How or what do I need to do to expose the .DLL''s?


如果你的DLL(使用那个包或者技巧DLL)被编译的话我得到了什么''并发送到其他地方,它不会包含任何dll包。所以这也必须转移。
What I was getting it that if your DLL (that uses that bag o tricks DLL) is ''compiled'' and sent elsewhere, it won''t contain the bag o tricks dll. So that will have to be transfered as well.


这篇关于C#+ DLL依赖问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆