Recently while working with the SharePoint server object model inside a windows application, I received the below error. System.PlatformNotSupportedException occurred in Microsoft.SharePoint.dll. An unhandled exception of type ‘System.PlatformNotSupportedException’ occurred in Microsoft.SharePoint.dll. Additional information: Microsoft SharePoint is not supported in 32-bit process. Please verify that you are running in a 64-bit executable.
We can work with the SharePoint server object model inside a windows application by adding Microsoft.SharePoint.dll.
Microsoft SharePoint is not supported in 32-bit process
To resolve the issue, Right click on the Project -> Properties.
Then select Build and uncheck Prefer 32-bit option which looks like below.
After this Microsoft SharePoint is not supported in 32-bit process. Please verify that you are running in a 64-bit executable will not appear.
Read some SharePoint server object model tutorials:
- How to get choices from choice field programmatically in SharePoint
- SharePoint 2013: Add, Delete and Display User Custom Actions using SharePoint Server Object Model
- Difference between client side object model and server side object model in SharePoint
- Create Site Columns programmatically in SharePoint 2016/2013 using Server Object Model in Visual Studio 2017
- Add SharePoint 2016/2013 List/Library Columns to view programmatically using server object model in Visual Studio 2017
- Upload file to SharePoint 2016 document library with metadata programmatically using file upload control
- Trying to use an SPWeb Object that has been closed or disposed and is no longer valid SharePoint 2013/3016 Server Object Model
- Add, Update, Delete & Display List items in Gridview Programmatically in SharePoint 2016
I hope this tutorial will be helpful to resolve Microsoft SharePoint is not supported in 32-bit process. Please verify that you are running in a 64-bit executable.
Hello Everyone!! I am Bhawana a SharePoint MVP and having about 10+ years of SharePoint experience as well as in .Net technologies. I have worked in all the versions of SharePoint from wss to Office 365. I have good exposure in Customization and Migration using Nintex, Metalogix tools. Now exploring more in SharePoint 2016 🙂 Hope here I can contribute and share my knowledge to the fullest. As I believe “There is no wealth like knowledge and no poverty like ignorance”