System.IO.FileNotFoundException was unhandled Message=The Web application at http://devbox1.com/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. Source=Microsoft.SharePoint StackTrace: at Microsoft.SharePoint.SPSite..ctor(SPFarm farm, Uri requestUri, Boolean contextSite, SPUserToken userToken) at Microsoft.SharePoint.SPSite..ctor(String requestUrl)
If you get this exception in custom application, when you try to open Site to which you have rights, check “Project Properties/Build/Platform target”.
Change it from: “x86” to “Any CPU” or “x64”.