The type or namespace name does not exist in the namespace, etc.

Visual Studio 2012.

I have two projects A and B. A is a console application. By default, the namespace A is "PayT". B is the class library type, the sAssembly name is "RetentionPolicyManager", and the default namespace for B is "RetentionPolicyManager".

Now in project A, I have added a reference to B which is RetentionPolicyManager.dll.

One class A has one line:

using PayT.RetentionPolicyManager;

      

However, I always got the error when rebuilding 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 a solution, it looks like everything is fine and errors.

+3


source to share


5 answers


I faced the same problem a few months ago. The problem was that both projects were not targeting the same platform , meaning the console application was targeting .Net framework 4.0 Client Profile

, whereas the library was targeting full .Net framework 4.0

.



Fixed by setting full .NET 4.0 environment for both projects.

+10


source


Which, since it RetentionPolicyManager

doesn't exist in PayT

, it's its own namespace in a separate dll, you just need to:



 using RetentionPolicyManager

      

+1


source


As per your description, it should be:

using RetentionPolicyManager;

0


source


In A

just use:

using RetentionPolicyManager;

      

0


source


namespace B is RetentionPolicyManager

, PayT

is the namespace of assembly A. remove PayT

from statement.

using RetentionPolicyManager;

      

0


source







All Articles