FileNotFoundException : The Web application at http://url could not be found.

When I started working with SPS 2010 APIs I got a mysterious but common error in my Visual Studio 2010 RC. I was working with a .NET console based application.  As normal I have double checked the URL, user permission, and even tried to create the SPSite instance with the IP address (eg: but I didn’t get any clue about this error.


Later, I came to know that once we start developing any .NET stand alone (windows based apps, console based apps) or web applications in Visual Studio 2010, the default build platform of the solution will be set to x86, and that was the reason I was getting that exception. Once I changed the target build platform to “Any CPU” issue got resolved !

1. Right click on the solution inside the solution explorer and select the “Configuration Manager”


2. Create a new active solution platform and select it as “Any CPU”, after that rebuild your application and you are 

    good to go.


Comments (3)

  1. Mike says:

    I have set my active solution platform to both "Any CPU" and x64 and neither one fixes the problem.  Any other possibilities you can think of?

  2. sowmyancs says:

    have you checked all other things like permission for the current user, URL etc ?

  3. anil says:

    Its not working try for new one………….

Skip to main content