Intellisense ignoring assembly reference

1.5k Views Asked by At

I have a Project assembly reference from one project in my solution to another.

It appears that VS2010's Intellisense doesn't realise the reference is there; it gives me

  • an error 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?) in my using statement

  • an error The name [class in referenced assembly] does not exist in the current context at the point where I use a class from the referenced assembly.

However, the reference works fine in practice: the referencing project builds successfully, and the code works fine.

(Both projects are targeted at the same framework. If it's relevant, this is a SharePoint project, so both assemblies live in the GAC; I don't know whether this means they could "find" each other even if the reference is in fact missing.)

I've had similar issues referencing this assembly from other assemblies before. Generally the error only stays in the Error List while the file with the reference in is open.

As everything builds fine, this is really just an annoyance, but I would really like to fix it.

1

There are 1 best solutions below

1
On

In my case the solution was targeting the Client Profile by default. When I changed it to the non-client profile target framework it compiled properly.

Note that this issue can also manifest itself as the reverse problem where Intellisense works, but it won't compile.

enter image description here