5

I am working on a large web application implemented in ASP.net. The main part of application, much of it implemented by a 3rd party, is managed by others so I don't have much control over it.

I have implemented 8 ASP.net custom controls which compile to separate DLLs and are put into the application's bin folder. These controls have to link to a couple of DLLs (or should that be assemblies?) from the main application which are also stored in the bin folder. Let's call them MainAppCore1.dll and MainAppCore2.dll. These seem to be managed .NET code.

My problem is that the main application has been updated, and worse looks like regularly being updated in the near future, due to to bugs problems I have compiled all my controls against the original version of the main app dlls, so now they won't load. Obviously I can solve the issue by recompiling all the controls against the new versions of MainAppCore1.dll and MainAppCore2.dll but am looking for a smarter way

My question is: is it possible to keep 2 versions of the main app dlls in the bin folder so that my controls will keep working (probably) each time the main app is upgraded?

I don't want to have to edit the web.config file by the way as this would be politically complicated.

4

2 回答 2

4

简而言之,您不能。从广义上讲,只有在 GAC(全局程序集缓存)文件夹中才能在一个文件夹中拥有两个版本的 .net 程序集,这是一个特殊文件夹,可以运行多个版本的 .Net 程序集,并且您的控制程序集可以指向 GAC 中的特定版本,不管那里有多少个版本。一种可能的解决方案是要求您的第 3 方供应商强命名他们的 MainCore1.dll 并将其安装在 GAC 中,每次版本更改时,然后在您的 web.config 中您可以指向特定版本。

于 2012-06-26T13:19:14.253 回答
1

将您的 8 个自定义控件放在他们自己的库项目中,并从主要项目中引用该项目。大概一切都在源代码控制中,因此当您执行“获取最新”时不应该有任何版本控制问题。

于 2012-06-26T13:16:35.973 回答