{"id":582,"date":"2011-09-21T01:37:56","date_gmt":"2011-09-21T00:37:56","guid":{"rendered":"http:\/\/www.stuartroberts.net\/?p=582"},"modified":"2011-09-21T01:37:56","modified_gmt":"2011-09-21T00:37:56","slug":"error-sharepoint-unit-test-64-bit","status":"publish","type":"post","link":"http:\/\/www.stuartroberts.net\/index.php\/2011\/09\/21\/error-sharepoint-unit-test-64-bit\/","title":{"rendered":"Error Running SharePoint Unit Tests on 64 Bit Machine"},"content":{"rendered":"<p><em>System.IO.FileNotFoundException: The Web application at http:\/\/localhost 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<\/em><\/p>\n<p>If you get the above error while opening a site through an SPSite object while performing a unit test in Visual Studio 2010, a simple resolution is to update the test engine settings to run in a 64 bit process.<\/p>\n<p>To do this, highlight the test project in the <em>Solution Explorer<\/em> and from the <em>Test<\/em> menu, select <em>Edit Test Settings -> Local (local.testsettings)<\/em>.<\/p>\n<p>Next, select <em>Hosts<\/em> from the left hand pane and change the <em>Run tests in 32 bit or 64 bit process:<\/em> to <em>Run tests in 64 bit process on 64 bit machine<\/em>.<\/p>\n<p><a href=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/64-bit-test.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/64-bit-test.png\" alt=\"\" title=\"64 bit test\" width=\"764\" height=\"250\" class=\"aligncenter size-full wp-image-583\" srcset=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/64-bit-test.png 764w, http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/64-bit-test-300x98.png 300w, http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/64-bit-test-500x163.png 500w\" sizes=\"(max-width: 764px) 100vw, 764px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>System.IO.FileNotFoundException: The Web application at http:\/\/localhost 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 &hellip; <a href=\"http:\/\/www.stuartroberts.net\/index.php\/2011\/09\/21\/error-sharepoint-unit-test-64-bit\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"jetpack_post_was_ever_published":false,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":[]},"categories":[3,37],"tags":[81,36],"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/plx2I-9o","_links":{"self":[{"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/posts\/582"}],"collection":[{"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/comments?post=582"}],"version-history":[{"count":3,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/posts\/582\/revisions"}],"predecessor-version":[{"id":587,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/posts\/582\/revisions\/587"}],"wp:attachment":[{"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/media?parent=582"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/categories?post=582"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/tags?post=582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}