Skip to content
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

usepackagetargets updates to #r nuget syntax #45467

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/fsharp/tools/fsharp-interactive/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,16 @@ let f (x: Tensor) = sin (sqrt x)
printfn $"{f (dsharp.tensor 1.2)}"
```

By default ````#r "nuget: ...."```` will not use build targets from the package being referenced during restore. There is a usepackagetargets option to enable the use of these build targets when required, only add usepackagetargets=true if the referenced package was authored to require it during restore.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
By default ````#r "nuget: ...."```` will not use build targets from the package being referenced during restore. There is a usepackagetargets option to enable the use of these build targets when required, only add usepackagetargets=true if the referenced package was authored to require it during restore.
By default, ````#r "nuget: ...."```` doesn't use build targets from the package being referenced during restore. The `usepackagetargets` option enables the use of these build targets when required. Only add `usepackagetargets=true` if the referenced package was authored to require it during restore.

examples:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
examples:
Examples:


```fsharp
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good if we knew any popular(ish) package that indeed needs this and make an example out of it here, do we?

// load fsharp.data nugetpackage and consume buildtargets from fsharp.data package during restore.
#r "nuget:fsharp.data,usepackagetargets=true"
#r "nuget:fsharp.data,6.6.0,usepackagetargets=false"
#r "nuget:fsharp.data,6.6.0,usepackagetargets=true"
```

### 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:
Expand Down