Description: When we create any application(in my case it was a console application) using VS 2010 and try to build it gives “The type or namespace could not found“ error (for me it gives me for Microsoft.Sharepoint), although it was showing added.
Resolution: The reason was in the properties of project. Target Framework was by default selected as .Net Framework 4 Client Profile. But as per Microsoft: “If you are targeting
the .NET Framework 4 Client Profile, you cannot reference an assembly that is not in the .NET Framework 4 Client Profile. Instead you must target the .NET Framework 4.” So as soon as I changed it to either .Net Framework 4.0 or 3.5, it started working.
Happy coding.
Hope it helps.
No comments:
Post a Comment