如何在本地测试 sharepoint Web 部件和其他 sharepoint 开发?
我一直在研究为 sharepoint 2010 构建 Web 部件,目前工作服务器上有一个 SP2010 实例。如果可能的话,我非常希望能够在本地(在我的笔记本电脑上)测试它们,而不必在我的笔记本电脑上安装 sharepoint 2010 (这可能吗?!)
有没有一种方法可以测试 Web 部件,我是否需要在我的笔记本电脑上安装全部/部分共享点?
谢谢
I have been investigating building web parts for sharepoint 2010 and currently have a single instance of SP2010 on the work servers. I would very much like to be able to test them locally (on my laptop) if possible, without having to install sharepoint 2010 on my laptop (is this even possible?!)
Is there a way to test web parts and do I need to install all/part of sharepoint on my laptop?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
如果您的 Web 部件只是显示在 SharePoint 页面中,而不使用 SP API,您可以简单地将其托管在笔记本电脑上的 ASP.NET 页面中,但这不是常见情况。
SP 2010 的一项新功能是客户端 API,即可以在服务器场外部使用的完整 API 的子集。如果您对 API 的使用符合此子集,这可能很有用,但您仍然需要访问某处的 SP 服务器。
另一种选择是将所有使用 SP API 的代码放在类似于数据库访问层的位置,该层一方面与 SP 通信并返回业务对象(不是列表或列表项)。这样,您就可以在笔记本电脑上模拟此部分,并专注于 Web 部分的外观及其业务规则,而无需 SP。如果这部分位于其自己的 DLL 中,则对 SP DLL 的唯一引用将在那里,因此笔记本电脑上的项目不需要引用 SP DLL。
If your Web part is simply displayed in a SharePoint page, without using the SP API, you could simply host it in an ASP.NET page on your laptop, but this is not a common scenario.
One new feature of SP 2010 is the client API, i.e. a subset of the full API that can be used outside of the farm. If your usage of the API fits in this subset, this could be useful, but you will still need to access a SP server somewhere.
Another option is to put all the code that uses the SP API in something similar to a Database Access Layer which talks to SP on one hand and returns business objects (not lists or lists items). This way, you could simulate this part on your laptop and concentrate on the look of the Web part and its business rules, without SP. If this part is in its own DLL, the only reference to SP DLLs would be there, so the project on your laptop would not need to reference the SP DLLs.
有两种方法:好的方法和老派方法。
好方法是安装 Sharepoint Services (http://technet.microsoft .com/en-us/windowsserver/sharepoint/default.aspx)并在本地部署 WP。它仅适用于 Windows Vista 或 Windows 7。这是最有效的方法,所以我推荐它。
另一种方法来自 SP2003 时代...其想法是开发自定义 Web 控件,使用 IIS 或仅开发服务器在本地测试它,然后将其嵌入到 Web 部件中。该方法在此描述 - http://www.reflectionit.nl/SmartPart.aspx 。这是一种古老而痛苦的方法。不幸的是,我们无法使用(没有麻烦)Microsoft.Sharepoint.dll 等
。对不起我的英语...
There are two ways: the good one and old-school.
The good way is to install Sharepoint Services (http://technet.microsoft.com/en-us/windowsserver/sharepoint/default.aspx) and deploy WP locally. It works only if you have Windows Vista or Seven. It is the most productive way so i recomend it.
Another way comes from SP2003 era... The idea is to develop custom Web Control, test it locally with IIS or just development server, and then to embed it into web part. The method is described here - http://www.reflectionit.nl/SmartPart.aspx . It's an old and painful method. Unfortunately we can't use (without troubles) Microsoft.Sharepoint.dll etc
P.S. Sorry for my English...
这个问题是在我们的办公室提出的,我们最终在每个开发人员的 PC 上安装了 Sharepoint Foundation,这使我们能够在本地进行开发和调试。这是我用来让它工作的链接。
安装开发环境。对于 Win 7 上的 Sharepoint Foundation
This came up at our office and we ended up installing Sharepoint Foundation on each developer's PC, which allows us to develop and debug locally. Here is the link that I used to get this working.
Setup Dev Env. For Sharepoint Foundation on Win 7
我会说获得一个虚拟机..但我不认为你可以在 32 位操作系统上运行 64 位虚拟机。
您必须升级到 64 位。
我不认为有什么好的办法可以解决这个问题;如果您没有在笔记本电脑或虚拟机中安装 SharePoint 并以正确的方式进行安装,那么您将花费大量时间在一些有问题的价值上。
I would say get a virtual machine.. but I dont think you can run 64bit VM's on a 32bit OS.
You'll have to upgrade to 64bit.
I don't think there is a good way around this; you will spend a lot of time on something of questionable value if you do not install SharePoint either on your laptop or in a VM and do it the proper way.
您只需将 SharePoint Web 部件的继承替换为 ASP.NET 等效项,然后再换回来 - 所有功能都是相同的,因为较新版本的设计考虑了向后兼容性。在笔记本电脑上测试时使用 ASP.NET 版本。
这里有一些更多信息:-)
http://weblogs.asp.net/scottgu/archive/2006/09/02/Writing-Custom-Web-Parts-for-SharePoint-2007.aspx
You can just swap out the inheritance from the SharePoint Web Part to the ASP.NET equivalent and back again - all the functionality is the same because the newer version was designed with backwards compatibility in mind. Use the ASP.NET version when testing on your laptop.
Here is some more info :-)
http://weblogs.asp.net/scottgu/archive/2006/09/02/Writing-Custom-Web-Parts-for-SharePoint-2007.aspx