none
#r "...." RRS feed

  • Question

  • I am trying to use Freebase.

    I create a new peoject ->library and then...

    // Learn more about F# at http://fsharp.net. See the 'F# Tutorial' project
    // for more guidance on F# programming.

    #load "Library1.fs"
    #r  "Samples.DataStore.Freebase.dll"

    but, F# interactive shows the msg:

    Script.fsx(7,1): error FS0082: Could not resolve this reference. Could not locate the assembly "Samples.DataStore.Freebase.dll". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. (Code=MSB3245)


    Script.fsx(7,1): error FS0084: Assembly reference 'Samples.DataStore.Freebase.dll' was not found or is invalid

    1-What should I do to do in order to use freebase (with intelisense)?

    2-I ve been having a hard time to understand and use references, ....fsx, etc... What would be a good video to understand how to use @ load, #r etc,etc???


    DaFonseca

    Tuesday, July 30, 2013 8:33 PM

All replies

  • @load and #r are for use in interactive scripting when there is no project file to orchestrate these details; and in that sort of situation, you may also need to use #i to add the directory path to the reference search list.

    However, you are using a project that emits an assembly, to to set up references, you use the right-click context menu on the project in the solution view to add the reference (as you would in C#), browsing to the assembly location.

    Wednesday, July 31, 2013 7:05 AM
  • Do you mean in case I am working directly on F# interctive I can command:

    #r "Samples.DataStore.Freebase.dll"
       type Webdata = Samples.DataStore.Freebase.FreebaseDat

    It is not working.. Any clue?

    Another question would be. When using a project how can use Freebase or Worldbank data (with intelisense)? Do I have to add theses as references?? As a solution? an assembly??

    what if i want to use show.fs.. Should I save it on project directory and add a reference using browse?


    DaFonseca

    Wednesday, July 31, 2013 5:52 PM
  • A worked example using some of my own private projects as a source, as I've not done anything that would make use of freebase

    If you try to open a namespace that isn't in any referenced assembly, you get an error at the first unknown facet in that namespace name

    > open Tinesware.Infrastructure;;
    
      open Tinesware.Infrastructure;;
      -----^^^^^^^^^
    
    stdin(1,6): error FS0039: The namespace or module 'Tinesware' is not defined

    If you try to reference a non-GAC assembly that's not in the standard search path you get resolution failure

    > #r "Tinesware.Infrastructure.dll";;
    
      #r "Tinesware.Infrastructure.dll"
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
    stdin(2,1): error FS0082: Could not resolve this reference. Could not locate the assembly "Tinesware.Infrastructure.dll"
    . Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation er
    rors. (Code=MSB3245)
    
      #r "Tinesware.Infrastructure.dll"
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
    stdin(2,1): error FS0084: Assembly reference 'Tinesware.Infrastructure.dll' was not found or is invalid
    So what you have to do to get at the types you're after is add the folder containing the assembly to the search path, then reference it, then open the namespace:
    > #I "E:\\hg\\tinesware-tools\\Infrastructure\\_Output\\Debug+AnyCPU\\lib\\net40";;
    
    --> Added 'E:\hg\tinesware-tools\Infrastructure\_Output\Debug+AnyCPU\lib\net40' to library include path
    
    > #r "Tinesware.Infrastructure.dll";;
    
    --> Referenced 'E:\hg\tinesware-tools\Infrastructure\_Output\Debug+AnyCPU\lib\net40\Tinesware.Infrastructure.dll'
    
    > open Tinesware.Infrastructure;;
    >
    The MSDN page F# Interactive (fsi.exe) Reference section Differences Between the Interactive, Scripting and Compiled Environments gives some more context.
    Wednesday, July 31, 2013 9:49 PM