且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

ASP.NET如何在web.config中添加程序集?

更新时间:2021-12-06 23:51:26

projB中是否存在所有projA的依赖项?通常,如果它们在相同的解决方案中,那么我只会将其从一个项目添加到另一个项目中.

Are all of projA's dependencies in projB? Usually I'd just add a reference from one project to another if they are in the same solution.

如果要动态添加程序集,则可能需要考虑服务参考.通过将projA的DLL转储到没有真正提供它可能需要的所有DLL的垃圾箱中,因此可以通过多种方式将事物捆绑在一起,以便可以跨系统理解对象,例如使用XML的Web服务来举一个常见的例子.

If you want to add an assembly dynamically then maybe a service reference maybe something to consider. By dumping in projA's DLL into the bin that doesn't really give all the DLLs that it may require, thus there are ways to tie things together so that objects can be understood across systems, like web services using XML to give a common example.

我回想有关动态添加装配的问题是,您从哪里得到装配,可以将该零件自动化成为projB的一部分,因为这实际上是解决此类问题的通用方法.

My question back about adding an assembly dynamically is where would you get it from and can that part be automated to be part of projB as that is really the general solution to this kind of problem.

如何获得projA的所有依赖关系?是否有可能获取它,使其不依赖于可能运行于系统上的其他DLL.这就是错误告诉您的信息,即还存在一些组装项目.请注意,如果使用了许多级别的依赖关系,则程序集的添加可以持续很长时间.

How could you get all of projA's dependencies? Is it possible to get it so that it doesn't depend on a bunch of other DLLs that may or may not be on the system that this is to run. That is what the error is telling you, that there exists some assembly projC that is also required. Note that this adding of assemblies can continue for a long time if there are many levels of dependencies used.

总结答案:为了将projA加载到一些新项目中,您需要参考什么?那是您的问题,如果不知道依赖项是什么样,就很难直接回答.

Summarizing the answer: What would you need to reference in order to load projA into some new project? That's your problem which without knowing what the dependencies look like is rather hard to answer directly.