How can I reference System.IdentityModel.Tokens.Jwt in FSI?

38 views Asked by At

Here is my script:

#r "nuget: System.IdentityModel.Tokens.Jwt, 6.17"

open System.Text
open System.Security.Cryptography
open Microsoft.IdentityModel.Tokens

let mutable rsap = RSAParameters()

rsap.Exponent <- Encoding.ASCII.GetBytes("todo")
rsap.Modulus <- Encoding.ASCII.GetBytes("todo")

let key = RsaSecurityKey(rsap)

printfn $"Key ID: %s{key.KeyId}"

It fails with this error:

.../Scratch.fsx(7,20): error FS0039: The value or constructor 'RSAParameters' is not defined.

This is odd, because the System.IdentityModel.Tokens.Jwt package is referenced.

How can I use RSAParameters with FSI?


$ dotnet --version
7.0.115
0

There are 0 answers

Related Questions in F#