已添加引用,但无法识别命名空间 [英] Reference added but Namespace is not recognized

查看:73
本文介绍了已添加引用,但无法识别命名空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在项目中添加了一个DLL. DLL包含名称空间test.security.现在,无法识别test.security.为什么会这样?

I added a DLL to my project. The DLL contains the namespace test.security. Now, test.security is not recognized. Why is this?

我正在其他项目中使用此DLL,但没有其他问题.

I am using this DLL in other projects and I have no other problems.

推荐答案

通常取决于名称空间中的.例如,如果那里什么也没有,那么名称空间根本就不存在.

It often depends on what is in that namespace; for example, if nothing is in there then the namespace doesn't really exist.

还可能缺少一些其他依赖关系,这意味着编译器无法使用(直到添加引用)该名称空间中的任何类型(例如,如果该名称空间中的类型都依赖于来自Another.dll的某些类型,而您尚未引用Another.dll).

It is also possible that you are missing some other dependency which means that the compiler can't use (until the reference is added) any of the types in that namespace (for example, if the types in that namespace all depend on some type from Another.dll, and you haven't referenced Another.dll).

可能是您引用了错误的dll 版本,而您所引用的版本没有该名称空间.

It is possible you have referenced the wrong version of the dll, and the version you are referencing doesn't have that namespace.

编译器可能已经在告诉您有关参考问题的信息,这意味着它不能使用它-在错误/警告列表中查找.例如,它可能是物理上丢失的文件,或者是.NET版本不匹配,或者是强命名问题,这意味着它不能使用引用.

It is possible the compiler is already telling you about a reference problem, meaning it can't use it - look in the errors/warnings list. For example, it could be a physically missing file, or a .NET version mismatch, or a strong-naming issue, that means it can't use the reference.

这篇关于已添加引用,但无法识别命名空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆