Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6636419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:11:00+00:00 2026-05-25T23:11:00+00:00

I am trying something really simple in F# to try and test interaction with

  • 0

I am trying something really simple in F# to try and test interaction with the SharePoint 2010 API. I think I am running into a general problem with F#. Is there anyway that an F# script can access the SharePoint 2010 API?

I think my problem is due to the F# scripts running 32bit, and the SharePoint API is in 64bit.

An example of the code I’m trying to run is as follows:

#r "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\Microsoft.sharepoint.dll"
#r "System.ServiceModel.dll"

open System
open Microsoft.SharePoint

let GetListByUrl (listUrl:string) =
    use site = new SPSite(listUrl)
    use web = site.OpenWeb()
    let list = 
        if not (web = null) then web.GetList(listUrl)
    list

In the visual studio editor it says the following error: The Type System.ServiceModel.ChannelFactory`1 is required here and is unavailable. You must add a reference to assembly …

When the script is ran it gives the message: System.IO.FileNotFoundException: The Web application at… could not be found. Verify that you have typed the URL correctly…

Which is the error message I get if I try to access the SharePoint 2010 API from a 32bit c# console program. If I change the c# console program to Any CPU that message doesn’t appear.

However I’m trying to do this in an F# script which I guess is 32bit, so how would I work around that?

Also since this is probably a general problem with F# scripts and 64bit dlls, how would you work around the problem of needing to reference 64bit dlls in F# scripts?

Edit
I used corflags.exe in the visual studio cmd prompt to modify the fsi.exe to 64bit. I followed this guide: http://ig2600.blogspot.com/2010/05/making-fsharp-interpreter-fsi-run-in.html. That seemed to work, though the F# interactive window seemed slower. However when I ran the code above in the now 64bit fsi it said sharepoint does not work with .net 4.0. How would you run the F# interactive window in .net 3.5?

Edit
Because of the answer posted by F.Aquino in which he said I needed to add a reference to System.ServiceModel I have updated the code to add that.

That fixes the visual studio editor complaints that keep appearing with red squiggly lines everywhere. When the script is ran the results are the same, the script cannot access the sharepoint 2010 API which is the problem I am having.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T23:11:01+00:00Added an answer on May 25, 2026 at 11:11 pm

    You need to add a reference to System.ServiceModel

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

actually I thought I was trying something really simple. ControllerClassNameHandlerMapping sounded great to produce
I'm trying to do something really simple, but starting to realize that dates in
I am probably overlooking something really simple here but I am trying to redirect
I am sure this is something really simple, but I am going bonkers trying
I'm new to Android and I think I'm trying to do something really basic:
I'm trying something really simple: get a list of player urls from the youtube
I'm trying to do something really simple: run an Ant task from Maven. Foolproof,
Right now I'm trying to put together something really simple, learn from it, and
I'm new to mercurial and I'm trying to do something really simple but can't
I'm trying to do something that should be really simple. I have created a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.