从控制台测试SharePoint遇到的两个问题

1、明明已经引用了SharePoint的相关dll,但扔报找不到SPSite等类。其原因是控制台程序在VS2010下默认使用的.Net Framework是4.0,而SharePoint是使用的3.5的框架,所以需要将控制台使用的框架也改成3.5。

 

2、SPSite site = new SPSite("http://win-2n2ujh16hsg/");报

“The Web application at could not found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.”错误,在确认地址没错的前提下,检查控制台的Build输出的是否为X64,如果不是的话就会报这个错误,原因是SharePoint2010必需是在64位下运行。

posted @ 2012-07-09 16:05  吴东雷  阅读(278)  评论(0编辑  收藏  举报