Namespace 'SharePoint' does not exist in t

2019-04-08 13:42发布

So I am starting to learn C#, like literally just started learning, and coming from a Java background, it doesn't look too bad. However, I have a question. I am following THIS tutorial on using the client-object model. And just starting from the top, I added the references, but using Microsoft.SharePoint.Client; keeps giving me the error that "the namespace 'SharePoint' does not exist in the namespace 'Microsoft', but I clearly see it on the right side panel. So looking at the instructions, the only difference I can think of is that fact that I am using Visual Studio Express and thus do not have the option to choose which framework to use when creating a new project. Other than that, I don't know what the problem might be. Does anyone have any ideas on what else I could be missing or how to correct this problem?

6条回答
We Are One
2楼-- · 2019-04-08 14:06

Did you add the references to the Microsoft.SharePoint.Client assembly and Microsoft.SharePoint.Client.Runtime assembly as noted near the beginning of that tutorial?

查看更多
戒情不戒烟
3楼-- · 2019-04-08 14:14

Take a look at the references in your project and make sure you have the reference to the assembly. If it is not there try adding it, right click -->add reference and find "Microsoft.SharePoint.Client"

查看更多
霸刀☆藐视天下
4楼-- · 2019-04-08 14:17
  1. Add required references to the solution.
  2. Make sure that the target framework is 4 for SP2013(3.5 for SP2010).
查看更多
该账号已被封号
5楼-- · 2019-04-08 14:17

Did you do this part of the tutorial you mentioned above?

To build the application, you must add references to two assemblies, Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll. Installing SharePoint Foundation installs these assemblies on the server. The two assemblies are located in the following directory:

%ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\ISAPI

查看更多
疯言疯语
6楼-- · 2019-04-08 14:18

Thanks to those who mentioned the 4.0 framework.

Mine defaulted to .NET Framework 4 Client Profile (and I have no idea what that means), and the Namespaces looked good in Intellisense, but the build would say they weren't found! Crazy.

查看更多
\"骚年 ilove
7楼-- · 2019-04-08 14:26

Make sure that the target framework is 3.5 and not 4 i.e for SP2010

查看更多
登录 后发表回答