Thursday, March 21, 2013

Using LINQPad with SharePoint 2013 - BadImageFormatException and PlatformNotSupportedException


If you get any of those errors when running against SharePoint API in LINQPad:



BadImageFormatException: Could not load file or assembly 'file:///C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SharePoint\v4.0_15.0.0.0__71e9bce111e9429c\Microsoft.SharePoint.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.




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




You need to get yourself an AnyCPU version of LINQPad. Good thing that the author made one available.
It's called Download X64 build



2 comments:

Carl said...

Can you also help in pointing me to the SharePoint 2013 driver? Or a work instruction on how to configure LINQPad anyCPU version to connect with SharePoint 2013?

mark said...

I don't know if author of driver for 2010 updated it, but you could try with this:
http://www.mssharepointtips.com/tip.asp?id=1179