使用 C# 访问 Sharepoint - 在哪里可以找到参考库?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/590346/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Using C# to access Sharepoint - where can I find the reference library?
提问by taggers
I am currently writing a Windows application in C# that will add documents to a document library list. I am trying to reference Microsoft.Sharepoint, however I do not see the COM or .NET library inside visual studio 2005 add references lists. What dll do I need to reference and where can I find this?
我目前正在用 C# 编写一个 Windows 应用程序,它将向文档库列表中添加文档。我正在尝试引用 Microsoft.Sharepoint,但是我在 Visual Studio 2005 添加引用列表中没有看到 COM 或 .NET 库。我需要引用什么 dll 以及在哪里可以找到它?
Thanks,
谢谢,
Alex
亚历克斯
采纳答案by Robert MacLean
To access a document library I would recommend going through the list web service which SharePoint exposes. From personal experience that is the easiest, most portable and upgradable way.
要访问文档库,我建议通过 SharePoint 公开的列表 Web 服务。根据个人经验,这是最简单、最便携和可升级的方式。
The documentation for ALL the web services and .NET libraries to do it as well can be download in Visual studio extensions for windows sharepoint services
所有 Web 服务和 .NET 库的文档也可以在Visual Studio 扩展中下载Windows sharepoint 服务
回答by Szymon Rozga
I assume you're using Sharepoint 2007, so you are able to find the libraries in the Bin folder in the 12 Hive on where SP is installed. That is usually: C:\program files\common files\microsoft shared\web server extensions\12
我假设您使用的是 Sharepoint 2007,因此您可以在安装 SP 的 12 Hive 的 Bin 文件夹中找到这些库。那通常是:C:\program files\common files\microsoft shared\web server extensions\12
You will need a reference to Microsoft.SharePoint.dll.
您将需要对 Microsoft.SharePoint.dll 的引用。
回答by Flo
to access the SharePoint library you have to include following assembly into your project: Microsoft.SharePoint.dll
要访问 SharePoint 库,您必须在项目中包含以下程序集:Microsoft.SharePoint.dll
You can find it on your SharePoint Server under the 12 hives folder: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI
您可以在 SharePoint Server 的 12 hives 文件夹下找到它:C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI
There you can find some more assemblies you might need for more SharePoint functionality.
在那里,您可以找到更多 SharePoint 功能可能需要的程序集。
回答by jaloplo
What kind of application do you have to develop???
你要开发什么样的应用???
If it is a client application that will be execute on machines that are not the Sharepoint target machine you'll have to call to SharePoint web services to do the operations.
如果客户端应用程序将在不是 Sharepoint 目标计算机的计算机上执行,则您必须调用 SharePoint Web 服务来执行操作。
If your application will be executed on server, SharePoint machine, you can use the dll's that are on 12 folder. For developing, you'll have to copy the dll's on a local folder and reference them into your project. To check if the application works well have to be executed on the SharePoint machine not on the developing machine.
如果您的应用程序将在服务器、SharePoint 机器上执行,您可以使用 12 文件夹中的 dll。对于开发,您必须将 dll 复制到本地文件夹中并将它们引用到您的项目中。要检查应用程序是否运行良好,必须在 SharePoint 机器上而不是在开发机器上执行。