Platform in visual studio for sharepoint coding RRS feed

  • Question

  • I am new to sharepoint . When i was compling my code it was shwoing error exception file not found.

    But when i change the platform fromx86 to x64 it get remove . Why please enhance my knowledge.

    Thanks for your help

    Monday, June 22, 2015 5:28 AM


  • Visual Studio (VS) is 32 bit application but can run an application in both 32 and 64 bit mode. SharePoint is 64 bit application and requires any application using SharePoint API directly to run in 64-bit mode. You can't call/use 64 bit DLLs from 32-bit DLLs or vice versa.

    Now when you create a project in VS, its 'Any CPU' mode by default - means the app can run in both 32 or 64 mode. Now Visual Studio is running in 32-bit mode so an application with 'Any CPU' settings will be launched as 32-bit application by default - as any CPU means use my host application settings and in this case host application is VS.

    So to work with SharePoint API you need to run your application in 64-bit mode and by setting the platform to 'x64' you force VS to generate DLLs and run application in 64-bit mode - which makes the application possible to communicate to SharePoint API.

    Sohel Rana

    Monday, June 22, 2015 6:09 AM