c# – The type or namespace name could not be found

c# – 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..

In my case I had:

Referenced DLL : .NET 4.5

Project : .NET 4.0

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

c# – The type or namespace name could not be found

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

Leave a Reply

Your email address will not be published.