2

Possible Duplicate:
F#/C# - fsx Script Files and Project References

I have moved some F# files into a different project, and now referencing them from an F# script looks quite ugly. Here's what I had to do to reference an assembly "MyLib.dll":

// Commented out: does not work! // #r "MyLib.dll"

// Ugly!

r "..\MyLib\bin\Debug\MyLib.dll"

I tried to add a reference path to a project settings, but it didn't help either. Of course the assembly MyLib.dll is added to my project's referenced assemblies, but looks like FSX script files does not really care - I have to list assemblies in a script file using their absolute or relative path.

Is this by design or there is a better way?

Community
  • 1
  • 1
Vagif Abilov
  • 9,835
  • 8
  • 55
  • 100
  • 3
    There's the syntax ` #I @"../MyLib/bin/Debug/` to add a path to search in, but it's only useful if you're referencing multiple code files/dlls. – Mark H Jul 06 '10 at 06:26
  • Thanks, I wasn't aware of the "I" directive. Still it's pity that F# script ignores referenced assemblies. – Vagif Abilov Jul 06 '10 at 07:29
  • I see now it's a duplicate. There was already a question about this, with a crazy hack workaround among the answers. – Vagif Abilov Jul 06 '10 at 08:20

0 Answers0