The type or namespace name could not be found
See this question.
Turns out this was a client profiling issue.
PrjForm was set to ".Net Framework 4 Client Profile"
I changed it to ".Net Framework 4", and now I have a successful build.
Thanks everyone!
I guess it figures that after all that time spent searching online, I find the solution minutes after posting, I guess the trick is knowing the right question to ask..
Getting type or namespace name could not be found but everything seems ok?
This can be the result of a .Net framework version incompatibility between two projects.
It can happen in two ways:
- a client profile project referencing a full framework project; or
- an older framework version targeting a newer framework version
For example it will happen when an application is set to target the .Net 4 Client Profile framework, and the project it references targets the full .Net 4 framework.
So to make that clearer:
- Project A targets the Client Profile framework
- Project A references Project B
- Project B targets the full framework
The solution in this case is to either upgrade the framework target of the application (Project A), or downgrade the target of referenced assembly (Project B). It is okay for a full framework app to reference/consume a client profile framework assembly, but not the other way round (client profile cannot reference full framework targeted assembly).
Note that you can also get this error when you create a new project in VS2012 or VS2013 (which uses .Net 4.5 as the default framework) and:
the referencing project(s) use .Net 4.0 (this is common when you have migrated from VS2010 to VS2012 or VS2013 and you then add a new project)
the referenced projects use a greater version i.e. 4.5.1 or 4.5.3 (you've re-targeted your existing projects to the latest version, but VS still creates new projects targeting v4.5, and you then reference those older projects from the new project)
VS2019: The type or namespace name could not be found
It was visual studio intellisense problem and following this steps helps me resolve it
- Clean solution
- Close visual studio
- Delete
.suo
file located relatively to source in:.vs\SolutionName\v16\.suo
- Reopen VS and build solution
Related Topics
Encrypt and Decrypt a String in C#
Send Http Post Request in .Net
Send Values from One Form to Another Form
Sending Email Through Gmail Smtp Server With C#
How to Pass Data (And References) Between Scenes in Unity
How to Do Impersonation in .Net
What Is the Correct Way to Create a Single-Instance Wpf Application
What Are the Differences Between a Multidimensional Array and an Array of Arrays in C#
Fastest Way of Inserting in Entity Framework
Collection Was Modified; Enumeration Operation May Not Execute
Is There a Constraint That Restricts My Generic Method to Numeric Types
Difference Between a Reference Type and Value Type in C#
Is There a String Math Evaluator in .Net