使用对象模型访问共享点站点
我正在尝试从控制台应用程序使用 SP 对象模型访问共享点站点。
我正在尝试做这样的事情..
SPSite site = new SPSite(sitePath)
//Operations go here
当共享点站点和控制台应用程序位于同一台计算机上时,这可以正常工作。
但是,当控制台应用程序和站点位于不同的计算机上时,我收到错误“The Web application at "http找不到“://server/url”。请验证您是否正确键入了 URL。如果该 URL 应提供现有内容,系统管理员可能需要添加新的请求 URL 映射到目标应用程序"
以下是我已经完成的操作:
1) 我尝试通过 IP 地址和计算机名称访问该网站,假设这可能是 DNS 解析问题。
2)最初我冒充使用农场管理员帐户,但仍然无法访问。然后我将自己添加为农场管理员,但仍然不高兴。
4) 该网站可通过 IE 访问。所以我想这不是权限问题。
5)我已经尝试了通过谷歌搜索错误消息获得的各种链接建议的几乎所有解决方案。
我正在共享点 2010 上尝试此操作。2007 年也出现类似的问题。有时,进行 SharePoint 开发是一件令人沮丧的事情,因为我有一种从一个错误跌跌撞撞到下一个错误的感觉,不知道可能出了什么问题,而且错误消息一点也没有帮助:(
I am trying to access a share point site using the SP object model from a console application.
I am trying to do something like this..
SPSite site = new SPSite(sitePath)
//Operations go here
This works fine when the share point site and the console app are on the same machine.
However when the console app and the site are on different machines, I get an error "The Web application at "http://server/url" could not be 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"
Here are the things that I have already done:
1) I have tried accessing the site via both IP address as well as machine name, assuming that it could be a DNS resolution issue.
2) Initially I impersonated using a farm admin account, still i could not access. Then I added myself as the farm admin, still no joy.
4) The site is accessible via IE. So it is not a permission issue I guess.
5) I have tried almost all the solutions suggested by various links obtained by googling the error message.
I am trying this on share point 2010. A similar issue occurs on 2007 also. Sometimes its kind of frustrating to do SharePoint development , since I get the feeling of stumbling from one error to the next, with no clue as to what could be wrong and the error messages not being helpful in the least :(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确实如此,因为您无法在另一台计算机上运行服务器对象模型。您可以使用客户端对象模型
That is true because you can't run server object model on another machine. You can use client object model