You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
In scripts, TypeProviderConfig.ReferencedAssemblies doesn't always include package-transitive or incremental assembly references #13710
When instantiating a type provider we pass it a TypeProviderConfig. This includes a ReferencedAssemblies property that reports the compilation context.
However, consider a script when referencing a component that has transitive nuget package dependencies:
#r "nuget: FSharp.Data, 5.0.1"
open FSharp.Data
type Auth = JsonProvider<"""{ "test": 1 }""">
let auth = Auth.Parse("""{ "test": 1 }""")
printfn $"{auth.Test}"
Here FSharp.Data 5.0.1 has multiple transitive package references such as FSharp.Data.Json.Core, 5.0.1.
The type providers in FSharp.Data.dll are instantiated as soon as the implied #r for FSharp.Data.dll is processed, which is before the transitive references. This is because the individual #r implied for #r "nuget: ..." declarations are processed one by one in some arbitrary order. This means the reported reference set is not complete.
Additionally, in a dynamic F# Interactive context, the ReferencedAssemblies in the TypeProviderContext do not later report any additional #r to individual DLLs - it only reports the references as they are precisely at the point where the reference to the type provider assembly is processed. (Note this only affects explicit assembly references, which can be manually reordered).
changed the title [-]The ReferencedAssemblies in TypeProviderContext doesn't include transitive references[/-][+]In scripts, the ReferencedAssemblies in TypeProviderContext doesn't include package-transitive or incremental assembly references [/+]on Aug 17, 2022
changed the title [-]In scripts, the ReferencedAssemblies in TypeProviderContext doesn't include package-transitive or incremental assembly references [/-][+]In scripts, TypeProviderConfig.ReferencedAssemblies doesn't include package-transitive or incremental assembly references [/+]on Aug 17, 2022
changed the title [-]In scripts, TypeProviderConfig.ReferencedAssemblies doesn't include package-transitive or incremental assembly references [/-][+]In scripts, TypeProviderConfig.ReferencedAssemblies doesn't always include package-transitive or incremental assembly references [/+]on Aug 17, 2022
Activity
[-]The ReferencedAssemblies in TypeProviderContext doesn't include transitive references[/-][+]In scripts, the ReferencedAssemblies in TypeProviderContext doesn't include package-transitive or incremental assembly references [/+]dsyme commentedon Aug 17, 2022
The fix is here - still needs automated testing #13721
[-]In scripts, the ReferencedAssemblies in TypeProviderContext doesn't include package-transitive or incremental assembly references [/-][+]In scripts, TypeProviderConfig.ReferencedAssemblies doesn't include package-transitive or incremental assembly references [/+][-]In scripts, TypeProviderConfig.ReferencedAssemblies doesn't include package-transitive or incremental assembly references [/-][+]In scripts, TypeProviderConfig.ReferencedAssemblies doesn't always include package-transitive or incremental assembly references [/+]