-
Notifications
You must be signed in to change notification settings - Fork 6k
Document relative path limitation and add cross-platform examples for F# Interactive #i directive #49118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Document relative path limitation and add cross-platform examples for F# Interactive #i directive #49118
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,9 +1,10 @@ | ||||||||||||||||||||||
--- | ||||||||||||||||||||||
title: F# Interactive (dotnet) Reference | ||||||||||||||||||||||
description: Learn how F# Interactive (dotnet fsi) is used to run F# code interactively at the console or to execute F# scripts. | ||||||||||||||||||||||
ms.date: 11/29/2020 | ||||||||||||||||||||||
ms.date: 10/13/2025 | ||||||||||||||||||||||
f1_keywords: | ||||||||||||||||||||||
- VS.ToolsOptionsPages.F#_Tools.F#_Interactive | ||||||||||||||||||||||
ai-usage: ai-assisted | ||||||||||||||||||||||
--- | ||||||||||||||||||||||
# Interactive programming with F\# | ||||||||||||||||||||||
|
||||||||||||||||||||||
|
@@ -170,16 +171,21 @@ Examples: | |||||||||||||||||||||
|
||||||||||||||||||||||
### Specifying a package source | ||||||||||||||||||||||
|
||||||||||||||||||||||
You can also specify a package source with the `#i` command. The following example specifies a remote and a local source: | ||||||||||||||||||||||
You can also specify a package source with the `#i` command. The following examples specify a remote source and local sources on different operating systems: | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nitpick] The phrase 'on different operating systems' is somewhat redundant since the examples themselves make this clear. Consider simplifying to 'The following examples specify remote and local sources:'
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||||||
|
||||||||||||||||||||||
```fsharp | ||||||||||||||||||||||
#i "nuget: https://my-remote-package-source/index.json" | ||||||||||||||||||||||
#i """nuget: C:\path\to\my\local\source""" | ||||||||||||||||||||||
#i "nuget: /Users/username/path/to/my/local/source" | ||||||||||||||||||||||
#i "nuget: /home/username/path/to/my/local/source" | ||||||||||||||||||||||
``` | ||||||||||||||||||||||
|
||||||||||||||||||||||
This will tell the resolution engine under the covers to also take into account the remote and/or local sources added to a script. | ||||||||||||||||||||||
This tells the resolution engine to take into account the remote and/or local sources added to a script. | ||||||||||||||||||||||
|
||||||||||||||||||||||
You can specify as many package references as you like in a script. | ||||||||||||||||||||||
You can specify as many package sources as you like in a script. | ||||||||||||||||||||||
|
||||||||||||||||||||||
> [!IMPORTANT] | ||||||||||||||||||||||
> Relative paths aren't currently supported with the `#i` directive. You must use absolute paths for local package sources. This limitation is tracked in [dotnet/fsharp#12969](https://github.com/dotnet/fsharp/issues/12969). As a workaround, construct absolute paths programmatically using `__SOURCE_DIRECTORY__` combined with `System.IO.Path.Combine()`, and then manually specify the full absolute path in your script. | ||||||||||||||||||||||
|
||||||||||||||||||||||
Comment on lines
+188
to
189
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The workaround explanation could be clearer. The phrase 'and then manually specify the full absolute path in your script' is confusing since it suggests manual work after programmatic construction. Consider clarifying how users would actually implement this workaround with a brief code example.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||||||
> [!NOTE] | ||||||||||||||||||||||
> There's currently a limitation for scripts that use framework references (e.g.`Microsoft.NET.Sdk.Web` or `Microsoft.NET.Sdk.WindowsDesktop`). Packages like Saturn, Giraffe, WinForms are not available. This is being tracked in issue [#9417](https://github.com/dotnet/fsharp/issues/9417). | ||||||||||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.