命名空间“SharePoint”命名空间“Microsoft”中不存在
我正在关注本教程使用客户端对象模型。从顶部开始,我添加了引用,但是 using Microsoft.SharePoint.Client;
不断给我错误:
命名空间“Microsoft”中不存在命名空间“SharePoint”
但我在右侧面板上清楚地看到它。因此,查看说明,我能想到的唯一区别是我使用的是 Visual Studio Express,因此在创建新项目时无法选择使用哪个框架。除此之外,我不知道问题可能是什么。
有谁知道我还可能缺少什么或如何纠正这个问题?
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:
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 the 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
您需要将引用添加到
Microsoft.SharePoint.Client
程序集和Microsoft.SharePoint.Client.Runtime
程序集 在该教程的开头附近指出:You need to add the references to the
Microsoft.SharePoint.Client
assembly andMicrosoft.SharePoint.Client.Runtime
assembly as noted near the beginning of that tutorial:确保目标框架是 3.5 而不是 SP2010 的 4
Make sure that the target framework is 3.5 and not 4 i.e for SP2010
您完成了上面提到的教程的这一部分吗?
Did you do this part of the tutorial you mentioned above?
查看项目中的引用并确保您拥有对该程序集的引用。如果不存在,请尝试添加它,右键单击 --> 添加引用并找到“Microsoft.SharePoint.Client”
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"
对于任何为 SP2019 进行开发的人,您需要以 .net 4.5 为目标
for anyone developing for SP2019, you need to target .net 4.5