The type or namespace name could not be found

This question already has an answer here:

  • Getting “type or namespace name could not be found” but everything seems ok? 28 answers

  • 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..


    PrjForm was set to ".Net Framework 4 Client Profile" I changed it to ".Net Framework 4", and now I have a successful build.

    This worked for me too. Thanks a lot. I was trying an RDF example for dotNet where in I downloaded kit from dotnetrdf.

    NET4 Client Profile: Always target NET4 Client Profile for all your client desktop applications (including Windows Forms and WPF apps).

    NET4 Full framework: Target NET4 Full only if the features or assemblies that your app need are not included in the Client Profile. This includes: If you are building Server apps, Such as:

  • ASP.Net apps
  • Server-side ASMX based web services
  • If you use legacy client scenarios, Such as: o Use System.Data.OracleClient.dll which is deprecated in NET4 and not included in the Client Profile.

  • Use legacy Windows Workflow Foundation 3.0 or 3.5 (WF3.0 , WF3.5)
  • If you targeting developer scenarios and need tool such as MSBuild or need access to design assemblies such as System.Design.dll


    In my case I had:

    Referenced DLL : .NET 4.5

    Project : .NET 4.0

    Because of the above mismatch, the 4.0 project couldn't see inside the namespace of the 4.5 .DLL. I recompiled the .DLL to target .NET 4.0 and I was fine.

    链接地址: http://www.djcxy.com/p/38854.html

    上一篇: 恢复Nuget引用?

    下一篇: 无法找到类型或名称空间名称