Common issue: new SPSite API call returns "The Web application at http://server:port/ could not be f

Since the early times of SharePoint we receive support cases where a customer receives the following error message when using custom code with SharePoint:

 

"The Web application at http://server:port/ 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 most common reasons this error can occur:

1.    The code is executed on a different machine - The SharePoint object model (except the Client API) requires to be run on the SharePoint server itself. It is not possible to run the application on a server which is not within the same SharePoint farm the code is trying to access.

2.    Insufficient Rights on the site collection - The code is executed in context of an account which does not have read permission on the site collection

3.    Incorrect Url being used - Verify that the site works correct in a browser and double check that the server is correct registered in the AAM settings

4.    Incorrect bitness - The SharePoint object model needs to be executed with the same bitness as the operating system. That means you cannot use the SharePoint object model in a 32-bit application if the Operating System and SharePoint are installed as 64-bit version. Ensure to compile the project using the correct bitness (64-bit on a 64-bit machine vs. 32-bit on a 32-bit machine)

5.    Incorrect .NET framework version -  Ensure that the project is configured to use .NET 3.5. .NET 4.0 cannot be used with the current versions of SharePoint

 

Referenced from: http://blogs.technet.com/b/stefan_gossner/archive/2011/09/19/common-issue-new-spsite-returns-quot-the-web-application-at-http-server-port-could-not-be-found-quot.aspx

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值