Visual Studio 2010 개발 툴에서 SharePoint 2010 개발 시,

SPSite 객체를 가져오는데 아래와 같은 FileNotFoundException이 발생하여 당황스럽게 하는 경우가 있습니다. (사이트는 실제로 존재) 


실행 소스

using (SPSite site = new SPSite("http://shing208"))

using (SPWeb web = site.OpenWeb()) { }

 

에러 메시지

FileNotFoundException

The Web application at http://shing208 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.

 

원인 및 해결책(체크 사항)

SharePoint 2010 버전은 64비트만 지원하는데, 개발 진행시 빌드 옵션 사항이 32비트로 지정되어 있어 발생하였습니다.

해결 방법은 아래 이미지와 같이 프로젝트 속성으로 들어가, 빌드 플랫폼 타켓을 x64로 변경해주시면 됩니다.

                 

 

  

+ Recent posts