Tuesday, March 29, 2011

System.IO.FileNotFoundException was unhandled while opening SPSite from custom application

Technorati Tags:
If you get this exception:

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)

in custom application, when you try to open Site to which you have rights, check “Project Properties/Build/Platform target”.  If you have it set to: “x86” change it to “Any CPU” or “x64”.


No comments: