26
Aug
09

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.

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.  😦

Advertisements

23 Responses to “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.”


  1. 1 dungdlt
    April 28, 2010 at 6:35 am

    I have the same error! When i tried to open url by Site.Open method.

  2. 2 kc
    August 23, 2010 at 3:14 am

    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

  3. 6 sagalvis
    October 13, 2010 at 1:50 pm

    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 !!!!

  4. 7 Traben
    November 15, 2010 at 3:22 am

    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

  5. 8 navaz
    December 8, 2010 at 3:56 am

    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

  6. 9 Rocky
    February 24, 2011 at 6:43 pm

    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.

  7. 10 Deepak Solanki
    March 10, 2011 at 6:37 am

    It worked for me also.. thnx..

  8. 11 Shaun Curtis
    May 26, 2011 at 2:44 am

    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.

  9. 12 Raja
    July 7, 2011 at 10:53 pm

    KC’s reply worked for me. changing platform target to x64

  10. 14 John Baranski
    August 2, 2011 at 8:30 am

    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?

  11. 15 Amit
    August 3, 2011 at 6:18 am

    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

  12. 16 naveen
    December 26, 2011 at 8:06 am

    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

  13. 17 Somesh Bhalerao
    March 21, 2012 at 10:22 pm

    I did all nothing works for me. Just I did IISRESET and it works !

  14. March 28, 2012 at 4:12 am

    Thanks for the post this got me pointed in the right direction to resolve my error.

  15. 19 Karsten Markmann
    May 24, 2012 at 2:41 am

    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

    • 20 Russell Wright
      July 22, 2012 at 8:33 pm

      Thanks, Karsten! I’m sure this will be very helpful to others.

      Russ

      • January 9, 2014 at 7:37 am

        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 ,

  16. 22 MJay
    December 17, 2012 at 11:12 pm

    Changing the Build platform of the project to x64 did the trick for me….
    Thanks Guys…..
    Cheers MJay


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Asif Rehmani’s SharePoint Videos

SharePoint-Videos

Click to access a wealth of SharePoint videos

SharePoint Rx

SharePoint Rx Home

Categories

Posts by Date

August 2009
M T W T F S S
    Sep »
 12
3456789
10111213141516
17181920212223
24252627282930
31  
Support Wikipedia

%d bloggers like this: