NuGet references missing from Query object model?
Options
Hi,
If I load a LINQPad query file using the object model, as in
Thanks!
If I load a LINQPad query file using the object model, as in
LINQPad.ObjectModel.Query.Load(@"foo.linq")
, I noticed that the Query object doesn't list the NuGet references. However, these are there as elements when looking at source of the file. Is there another way to get those?Thanks!
Comments
-
You can get the XML properties of the script from the object model using the
GetRawHeader
method. It's fairly simple from there to get the NuGet references:LINQPad.ObjectModel.Query.Load(@"foo.linq").GetRawHeader().Elements("NuGetReference").Select(e => e.Value).Dump();
Example output:HtmlAgilityPack
Rx-Main
Rx-WinForms -
Yes, it's an omission that there's no NuGetReferences property. I'll fix this in the next beta build (day or two).
In the meantime, GetRawHeader will return everything, as kingkeith suggested. -