Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Oct 13, 2025

Fixes #44256

Summary

This PR addresses a documentation gap in the F# Interactive reference regarding the #i directive for specifying package sources. The documentation now clearly states that relative paths are not supported and provides comprehensive cross-platform examples.

Problem

Users were unclear whether relative paths work with the #i directive when specifying local package sources in F# Interactive. The documentation only showed a Windows absolute path example, leaving macOS and Linux users without guidance. For example, a user attempting to use:

#i "./my/local/packages"

would encounter an error with no explanation in the documentation about why this doesn't work or what the alternative is.

Changes

  1. Added cross-platform absolute path examples

    • macOS: /Users/username/path/to/my/local/source
    • Linux: /home/username/path/to/my/local/source
    • Maintained existing Windows and remote URL examples
  2. Added IMPORTANT callout clarifying that:

    • Relative paths aren't currently supported with the #i directive
    • Absolute paths must be used for local package sources
    • References tracking issue dotnet/fsharp#12969
    • Provides workaround using __SOURCE_DIRECTORY__ combined with System.IO.Path.Combine()
  3. Improved documentation quality

    • Used active voice and contractions for better readability
    • Fixed terminology (changed "package references" to "package sources")
    • Added ai-usage: ai-assisted frontmatter metadata
    • Updated ms.date to reflect current changes

Testing

Validated the behavior by testing F# Interactive:

  • ✅ Confirmed relative paths fail with "Invalid URI" error
  • ✅ Confirmed absolute paths work correctly across platforms
  • ✅ Verified documentation follows Microsoft style guidelines

Impact

This change directly answers the user's question and prevents confusion for developers trying to use local package sources in F# Interactive scripts on macOS and Linux. The documentation now provides clear guidance on what works, what doesn't, and why.

Original prompt

This section details on the original issue you should resolve

<issue_title>relative path for local package source - dotnet fsi (F#)</issue_title>
<issue_description>Hi i was trying to specify relative path on a mac for the package source in F# interactive (dotnet fsi), does that work or is there any workaround?

#i " ./my/local/packages"

Thanks,
have a great day


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Comments on the Issue (you are @copilot in this section)

@BillWagner ping @KathleenDollard @dsyme @BillWagner The docs should include a relative path example for `#i`. Alternatively, if relative paths aren't allowed, that should be stated.

Fixes #28973


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@dotnet-policy-service dotnet-policy-service bot added the okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings. label Oct 13, 2025
Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>
Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Fix relative path for local package source in dotnet fsi Document relative path limitation and add cross-platform examples for F# Interactive #i directive Oct 13, 2025
@Copilot Copilot AI requested a review from BillWagner October 13, 2025 18:39
Copilot finished work on behalf of BillWagner October 13, 2025 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dotnet-fsharp/svc okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

relative path for local package source - dotnet fsi (F#)

2 participants