简体   繁体   English

ASP.NET自定义代码库的命名和引用

[英]ASP.NET Custom Code Library Naming and Referencing

I'm coding against two existing versions of an old library called say Ab.Core (old) and AB.CORE (new). 我正在针对一个旧的库的两个现有版本进行编码,例如Ab.Core (旧)和AB.CORE (新)。

In VS 2010 I get the following error when trying to add a project reference for the older library (with the newer one already referenced): 在VS 2010中,尝试为较旧的库(已引用较新的库)添加项目引用时出现以下错误:

A reference to... Ab.Core could not be added. 无法添加对... Ab.Core的引用。 A reference to Ab.Core already exists in the project. 项目中已经存在对Ab.Core的引用。

It's looking like VS doesn't care about case sensitivity. 看起来VS不在乎大小写敏感。 I have to use both versions for a while - is there some way around this or some setting I can use? 我必须同时使用这两个版本-我可以使用某种方式解决此问题吗?

To reference two versions of assemblies that have the same fully-qualified type names,use an external assembly alias, the namespaces from each assembly can be wrapped inside root-level namespaces named by the alias, which enables them to be used in the same file. 要使用完全相同的类型名称引用两个版本的程序集,请使用外部程序集别名,每个程序集的名称空间都可以包装在由别名命名的根级名称空间中,从而使它们可以在同一文件中使用。

http://msdn.microsoft.com/en-us/library/ms173212(v=vs.100).aspx http://msdn.microsoft.com/en-us/library/ms173212(v=vs.100).aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM