Microsoft SharePoint is not supported in 32-bit process. Please verify that you are running in a 64-bit executable

StackOverflow https://stackoverflow.com/questions/20710798

Question

I'm writing a console app for SharePoint 2013 on a 64-bit machine. I get this error when I try to execute the program:

"Microsoft SharePoint is not supported in 32-bit process. Please verify that you are running in a 64-bit executable."

Please let me know if you've had this problem in the past and can help. Thank you!

Was it helpful?

Solution

Have you checked the the properties for your project? (solution explorer, right click on the project, click on properties) On the build tab check for that you select "Any CPU".

OTHER TIPS

This worked for me:

In Visual Studio: TOOLS>OPTIONS>Projects and Solutions>WEB PROJECT and Use the 64 bit versions of IIS Express for web sites and projects

I hit this problem while running a Unit Test (well, an integration test in "Unit Test" clothing). Changing the target for the unit test project just made the tests disappear from the Test Explorer. It is possible to run your tests (at least in VS2013+) as an x64 environment.

In Visual Studio, choose Test > Test Settings > Default Processor Architecture > x64.

https://msdn.microsoft.com/en-us/library/ee782531(v=vs.120).aspx

Sometimes, if "Prefer 32-bit" is greyed out, and your Platform Target is already "Any CPU", the problem is that IIS Express is not 32 bit.

The solution is to change the solution's web server to Local IIS.

This blog details the steps in more detail: Platform Not supported Exception when running Visual Studio Web Application

What worked for me was changing a registry key:

HCU\Software\Microsoft\VisualStudio\12.0\WebProjects\Use64BitIISExpress

to 1, as shown here:

https://rule30.wordpress.com/2015/06/22/microsoft-sharepoint-is-not-supported-in-32-bit-process-please-verify-that-you-are-running-in-a-64-bit-executable/

I got the same issue. The Build tab has the option Any CPU, but still it was not working.

I have selected explicitly x64 as the Platform target, and the application works fine :)

for me it was because of invalid reference to Microsoft.Shareppoint.dllafter migrating to SharePoint 2013 in a console application we used for some automation

just add below address of Microsoft.Shareppoint.dll

Correct

C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.dll

you can found this reference to this correct dll , after creating a empty SharePoint 2013 project in your UAT.

I was getting this error inside my Windows 2012 R2 UAT and Visual Studio 2015 Update 1 , when my reference was incorrectly to a dll found in GAC

Incorrect

   C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SharePoint\v4.0_15.0.0.0__71e9bce111e9429c\Microsoft.SharePoint.dll
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top