两个dll中具有相同命名空间的同一个类 [英] same class with same namespace in two dll
问题描述
我在我的mvc网站上使用AntiXssLibrary和SecuritySwitch,但它们都有Microsoft.Security.Application.Encoder类,所以一旦我使用这个类的api,
编译会给我错误。
我尝试通过以下建议解决问题,
http://blogs.msdn.com/b/ ansonh / archive / 2006/09/27 / 774692.aspx
但是这两个dll都看到他们的xml文件引用了api。所以一旦我重命名一个,我可能应该重命名xml文件中的ref。
如何轻松解决问题。
I use AntiXssLibrary and SecuritySwitch in my mvc website,but they both have "Microsoft.Security.Application.Encoder" class, so once i use api from this class,
the compile will give me a error.
I try to solve the problem with the follow suggest,
http://blogs.msdn.com/b/ansonh/archive/2006/09/27/774692.aspx
but the both the dll sees have their xml file ref the api. So once I rename one ,may be I should to rename the ref in the xml file.
How to easily solve the problem.
推荐答案
您好,
您可以使用全局命名空间别名: http://msdn.microsoft.com/en-us/library/cc713620.aspx [ ^ ]
一些有用的例子: http://msdn.microsoft.com/en-us/library/c3ay4x3d.aspx [ ^ ]
Hi,
You can use Global Namespace alias : http://msdn.microsoft.com/en-us/library/cc713620.aspx[^]
Some useful example : http://msdn.microsoft.com/en-us/library/c3ay4x3d.aspx[^]
这篇关于两个dll中具有相同命名空间的同一个类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!