fsprojects / zarchive-xamarin-monodevelop-fsharp-addin

(No longer Used) F# Editing Support In MonoDevelop and Xamarin Studio
Other
27 stars 22 forks source link

Send references to FSI fails #19

Closed 7sharp9 closed 9 years ago

7sharp9 commented 9 years ago

From @rojepp on February 18, 2015 6:0

In a small project that has a NuGet package (FSharp.Data.SqlClient) I right-click in a .fs file and choose 'Send references to F# Interactive', FSI fails to find the NuGet package. Output:

--> Referenced '/Library/Frameworks/Mono.framework/Versions/3.12.0/lib/mono/4.0/System.Core.dll' (file may be locked by F# Interactive process) --> Referenced '/Library/Frameworks/Mono.framework/Versions/3.12.0/lib/mono/4.0/System.Data.dll' (file may be locked by F# Interactive process)

r @"/Users/rojepp/Projects/quicksqlapp/quicksqlapp/../packages/FSharp.Data.SqlClient.1.5.10/lib/net40/FSharp.Data.SqlClient.dll"

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /stdin(5,1): error FS0078: Unable to find the file 'Microsoft.SqlServer.TransactSql.ScriptDom.dll' in any of /Library/Frameworks/Mono.framework/Versions/3.12.0/lib/mono/4.5 /Users/rojepp/Projects/quicksqlapp/quicksqlapp /Library/Frameworks/Mono.framework/Versions/3.12.0/lib/mono/4.0/

Note that it is actually a valid path to FSharp.Data.SqlClient, and if I copy that #r statement and execute it manually, it works. Also note that the error message I get is actually about a dll used by SqlClient.

Copied from original issue: fsharp/fsharpbinding#950

7sharp9 commented 9 years ago

I think its the old path issue with FSI, if the current directory is not the one in the current reference and the reference has other dependent references then you get that error.

This works fine for example:

#I @"/Users/dave/Projects/abcd/abcd/../packages/FSharp.Data.SqlClient.1.5.10/lib/net40/"
#r @"/Users/dave/Projects/abcd/abcd/../packages/FSharp.Data.SqlClient.1.5.10/lib/net40/FSharp.Data.SqlClient.dll"

I wish there was parity between the way things work on Windows and other platforms.

7sharp9 commented 9 years ago

From @rojepp on February 18, 2015 10:1

Could it be that we're missing a #silentCd, just prior to sending references. Note, I haven't checked the code yet. I just remember a lot of discussion about this ( #162 ) and Dons suggestion to just send it all the time because it is cheap. :)

7sharp9 commented 9 years ago

It is sent before the command, followed by all the #r's afterwards. I suspect in this instance it needs to be sent in-between each #r due to fsi's quirkiness.

7sharp9 commented 9 years ago

From @rojepp on February 18, 2015 10:12

I can try that out later on.

7sharp9 commented 9 years ago

I had a quick look, the current file's path is sent (#silentcd) before the list of #r references. I guess for nugets we will have to reconsider the silentcd logic. In this instance the dependencies are either .Net40 assembles or pcl ones which also muddies things. Actually pcl references are not implicitly added in checker either for tooltips etc, but thats another issue.

Im in the middle of porting for roslyn but Ill take a look when I get a chance.

7sharp9 commented 9 years ago

I cant actually remember how to progress this, implicit pcl references now work fine in fsharpMDXS though.

7sharp9 commented 9 years ago

Moved to bugzilla closing:https://bugzilla.xamarin.com/show_bug.cgi?id=33088