I was recently working on a custom windows application whose job was to bulk load content into SharePoint document libraries. I was testing it on the test server and then moved it over to the production server for the client to use. When they logged in with their admin account (account #1) and fired up the app, it wouldn’t do its job. Looking at the log file showed the error:
The web application at [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.
This error is basically a really verbose SharePoint “file not found” type of error. It’s saying that it can’t find the URL and suggesting that your SharePoint administrator might need to add an alternate access mapping to your SharePoint web application (extend the web app and add an alternate access mapping). It was occurring when instantiating and SPWeb object.
The funny thing about this error was that, if I logged on as an administrator, it went away and the app worked fine. That immediately suggested to me I had a permissions problem. So I looked all around for where the differences might be. The account was actually in the domain administrators group and had permissions that worked fine in SharePoint. It was a farm administrator and a site collection administrator. There was nothing it couldn’t access…except the SPWeb object.
We had a couple of other accounts that were similarly configured, so I tried one of the other accounts after spending hours “googling” (or was it “bing-ing?) a potential solution. While searching on the web, I found I had plenty of company with others who had similar problems. Many of proposed solutions revolved around swapping out accounts in specific application pools being utilized by SharePoint. However, most of these solutions do not take into account infrastructures that won’t allow these accounts to be changed to local system accounts. Whatever…
Okay, so I tried one of our other similarly configured accounts and found that it worked just fine. “What was the difference”, I pondered? I searched all over and found that account #2 was NOT a site collection administrator. In other words, the account that wasn’t working, account #1, WAS a site collection administrator and the account that WAS working was not. So, I removed it from the site collection administrators.
Guess what? My application suddenly started working when logged on as account #1. So, I put it back in to the site collection administrators group and found that it STILL WORKED! Just taking it out of the site collection administrators did something, somewhere in the vast security netherworld of SharePoint that flipped the appropriate “bit” and fixed whatever the original problem was. Problem solved. Only took eight hours. 😦
I have the same error! When i tried to open url by Site.Open method.
Hey, i found another solution:
http://blogs.msdn.com/b/jjameson/archive/2009/10/08/web-application-at-could-not-be-found-error-on-moss-2007-x64.aspx
Build the application on x64 CPU and it will work …. cant belive it
greetings
kc
Saved my day. Thanks kc
najro
thanks
same error!
There is another solution, built the aplication with Target Framework 3.5. and it worked right away. It seems the problem was with the .NET framework 4 !!!!
Ok … I tried with the user AppPool SSP and it works.
Now the problem is why?
This is not a problem with the NET Framework 4 because my application is a web service in WCF V4.0
hi ,
i have a problem …
im developing the timerjob for using windows applications and c#.net. This job can run on sharepoint check event. I have developed the applcation in .net when i use spcontext.current.site.url() this throw a eror..
coz i creating the applcation out side of sharepoint thats y..
pls any one slove this..
adv thanks.
revert to this mail plsssssssss………
muhammednavaz@gmail.com
thanks
There are two points need to pay attention:
1. SharePoint only support X64. So you application need to be built in X64 mode.
2. SharePoint only work in .NET 3.5, so don’t build your app in .NET 4.0. There is nothing wrong with .NET 4. Just SharePoint didnot support it.
It worked for me also.. thnx..
Rocky’s comments above are important. You need to make sure you have the necessary farm and site collection admin rights. In the project properties under Compile > Advanced Compile Options:
1. Set the Target CPU to x64 (any CPU also seems to work but definitely not x86!)
2. Set the Target framework to .Net 3.5.
KC’s reply worked for me. changing platform target to x64
changing x86 to ‘Any CPU’ worked for me! Thanks
I have a similar problem. We are using claims based authentication. When we access the SharePoint site from http we get in fine. However when we access it via https we get the following (we have the proper cert, ip, and port binding in IIS):
The web application at [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.
Has anyone had a similar issue?
I am getting similar problem and i tried following things but still error persists
1) Target framework .net 3.5
2) Platform target for solution : Any CPU
Please help
I had this problem before setting x64 instead of x86. then i set x64 as target platform. When i am log in with spadmin credentials its works fine but its not work while i am log in with ordinary user account
I did all nothing works for me. Just I did IISRESET and it works !
Thanks for the post this got me pointed in the right direction to resolve my error.
Hi The above solution didn’t work for me, but I found another solution that worked:
In the Powershell for Sharepoint Administration (Start it with the user that works, because powershell has the same issue), please type the following, which gives the user admin rights for all Sharepoint databases.
$dbs = Get-SPDatabase
foreach($d in $dbs) {Add-SPShellAdmin “domain\user” -database $d}
I found the solution here:
http://www.sharepointassist.com/2010/01/29/the-local-farm-is-not-accessible-cmdlets-with-featuredependencyid-are-not-registered/
Karsten
Thanks, Karsten! I’m sure this will be very helpful to others.
Russ
Hi Russell ,
Did you application connect to remote sites as well in the same network? I have a .net Windows 3.5 application target to x64 for doing admin operation , I am using SharePoint Server Object model. The tool works fine when the both site collection am trying to connect and the tool resides in the same server . When i try to connect to a remote site ( different server(VM) which exists in same network and domain) . It give web application not found error.
I have verified permission of the user runnign the tool , he is farm admin and also have access to all dbs.
Any suggestion would be really helpful.
Thanks ,
Changing the Build platform of the project to x64 did the trick for me….
Thanks Guys…..
Cheers MJay