2

I am building a Sharepoint utility using Sharepoint Client Object Model API in C#. I included the reference to the following libraries in my application:

using Microsoft.SharePoint.Client;

I can use the ClientContext class in my application without any problem like:

ClientContext ctxt = new ClientContext(siteURL);
ctxt.Credentials = websService.Credentials;
Web site = ctxt.Web;

But when I try to build my application, I get this following error:

The type or namespace name 'SharePoint' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

I searched more and found that the version of .NET Framework should be 3.5, but it is already set to 3.5.

Can anyone please guide where I'm going wrong and what exactly is causing this issue.

Just an FYI - I'm using Visual Studio 2013 to develop the application.

The path of the library is : C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll

Runtime Version : v4.0.30319 Version : 15.0.0.0

Abhishek
  • 1,974
  • 5
  • 31
  • 67
  • 2
    it could be that the referenced dll is built with `different .NET version` than your current project – Khanh TO Feb 15 '15 at 13:38
  • Inserting a `using ...;` declaration is _not_ adding a reference. – H H Feb 15 '15 at 13:43
  • @KhanhTO, thanks for replying. I added the libraries from what my VS-2013 showed me. Also, changing the .NET Framework to 4 worked perfectly. Can you please guide how does that work? – Abhishek Feb 15 '15 at 13:44
  • @HenkHolterman, I meant I added the reference to those libraries in my application and then used 'using..' to extend it's functionality. :) – Abhishek Feb 15 '15 at 13:45
  • This is already answered here: http://stackoverflow.com/questions/5567945/type-or-namespace-name-does-not-exist – Khanh TO Feb 15 '15 at 13:46
  • @CodeKaro - then document very carefully which _assemblies_ you are using, with version, path etc. If there is a real problem I can reopen this. – H H Feb 15 '15 at 13:47
  • @HenkHolterman, I have added the version and path of the library I used. – Abhishek Feb 15 '15 at 13:55

0 Answers0