简体   繁体   English

类型与导入的名称空间冲突

[英]The type conflicts with imported namespace

What causing this error. 是什么导致此错误。 I have 2 different page(.aspx) in one website. 我在一个网站上有2个不同的页面(.aspx)。 For the first page, i use using Facebook and doesn't have any error in this first page. 对于第一页,我使用using Facebook ,并且在第一页中没有任何错误。

But for another new .aspx page. 但是对于另一个新的.aspx页。 i using the using Facebook for reference but getting this error: 我使用using Facebook作为参考,但出现此错误:

The type 'Facebook' in 'C:\Users\Documents\VS2010\Websites\Test\FacebookIntegration.aspx' conflicts with the imported namespace 'Facebook' in 'C:\Users\Documents\VS2010\Websites\Test\Bin\Facebook.dll. Using the type defined in 'C:\Users\Documents\VS2010\Websites\Test\FacebookIntegration.aspx'.

can someone please tell me why this is happen? 有人可以告诉我为什么会这样吗? Thank in advance. 预先感谢。

Do you have a class named Facebook , and a namespace called Facebook ? 您是否有一个名为Facebook的类和一个名为Facebook的命名空间? If so, that's a problem. 如果是这样,那就是一个问题。 You should rename your class to something else, preferably something more descriptive. 您应该将班级重命名为其他名称,最好是更具描述性的名称。 If you end up with two third party products, rename both of them using an alias . 如果最终得到两个第三方产品,请使用别名将它们都重命名。

I'm guessing you have a page called FacebookIntegration.aspx, but maybe you originally called it Facebook.aspx and so the class name ended up being Facebook and you just need to rename it, probably make it match the file name. 我猜您有一个名为FacebookIntegration.aspx的页面,但是也许您最初将其称为Facebook.aspx,所以类名最终为Facebook ,您只需要重命名它,可能使其与文件名匹配即可。

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

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