Visual Studio 2012.
I have two projects A and B. A is the console application. The default namespace of A is “PayT’. B is class library type, the sAssembly name’ is ‘RetentionPolicyManager’, the default namespace of B is ‘RetentionPolicyManager’.
Now in project A, I added reference of B that is RetentionPolicyManager.dll to it.
In one class of A, there is one line:
using PayT.RetentionPolicyManager;
However I always got the error when I rebuild the solution:
The type or namespace name ‘RetentionPolicyManager’ does not exist in the namespace ‘PayT'(are you missing an assembly reference?)
If I don’t build the solution, it seems to be okay and no error.
I faced same issue some months ago. The problem was both projects didn’t target the same platform, i.e. the console application targeted
.Net framework 4.0 Client Profilewhile the library targetedfull .Net framework 4.0.Fixed by targeting full .Net 4.0 framework for both projects.