Intellisense忽略程序集引用

时间:2011-10-20 09:14:05

标签: .net visual-studio intellisense assembly-references

我有一个Project程序集引用,从我的解决方案中的一个项目到另一个项目。

看来VS2010的Intellisense没有意识到有参考;它给了我

  • 我的The type or namespace name [assembly-specific part of namespace] does not exist in the namespace [namespace common to both projects/assemblies] (are you missing an assembly reference?)声明中的错误using

  • 在我使用引用程序集中的类时出现错误The name [class in referenced assembly] does not exist in the current context

但是,该引用在实践中工作正常:引用项目构建成功,代码工作正常。

(两个项目都针对相同的框架。如果它是相关的,这是一个SharePoint项目,所以这两个程序集都存在于GAC中;我不知道这是否意味着即使参考也可以“找到”彼此实际上是缺失了。)

之前我从其他程序集引用此程序集时遇到了类似的问题。通常,当带有引用的文件打开时,错误仅保留在错误列表中。

随着一切正常,这真的只是一个烦恼,但我真的想解决它。

1 个答案:

答案 0 :(得分:1)

在我的情况下,解决方案默认情况下定位到客户端配置文件。当我将其更改为非客户端配置文件目标框架时,它已正确编译。

请注意,此问题也可能表现为Intellisense工作的反向问题,但不会编译。

enter image description here

相关问题