Skip to content

Commit 8d5d8df

Browse files
KevinRansomBillWagnergewarren
authored
usepackagetargets updates to #r nuget syntax (#45467)
* usepackagetargets updates to #r nuget syntax * Update index.md * Add usepackagetargets option example in docs * Fix formatting in F# Interactive documentation * Apply suggestions from code review Co-authored-by: Genevieve Warren <[email protected]> --------- Co-authored-by: Bill Wagner <[email protected]> Co-authored-by: Genevieve Warren <[email protected]>
1 parent b5c14f8 commit 8d5d8df

File tree

1 file changed

+10
-0
lines changed
  • docs/fsharp/tools/fsharp-interactive

1 file changed

+10
-0
lines changed

docs/fsharp/tools/fsharp-interactive/index.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,16 @@ let f (x: Tensor) = sin (sqrt x)
158158
printfn $"{f (dsharp.tensor 1.2)}"
159159
```
160160

161+
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.
162+
Examples:
163+
164+
```fsharp
165+
// load fsharp.data nugetpackage and consume buildtargets from fsharp.data package during restore.
166+
#r "nuget:fsharp.data,usepackagetargets=true"
167+
#r "nuget:fsharp.data,6.6.0,usepackagetargets=false"
168+
#r "nuget:fsharp.data,6.6.0,usepackagetargets=true"
169+
```
170+
161171
### Specifying a package source
162172

163173
You can also specify a package source with the `#i` command. The following example specifies a remote and a local source:

0 commit comments

Comments
 (0)