Linq not available (System.Core?)
Me again. Hopefully not many more questions going forwards...
I used Linq in my plugin, but then I get compilation errors when enabling it.
Have the Linq using reference (using System.Linq), and as far as I can tell ACT is running on .net 4.7, and the csproj includes a reference to System.Core, so I'm not sure what I'm missing here.
I can work around it, I've just found Linq to be easier to read/write, and I can't find a good reason it shouldn't work.
Comments
https://learn.microsoft.com/en-us/dotnet/api/system.linq?view=netframework-4.7.2
System.Linq is a namespace in the System.Core assembly.
System.Data.Linq is Microsoft's SQL supporting package, which uses Linq language to manage relationships between normalised database entities.
System.Xml.Linq is similar but for Xml Documents.
System.Linq itself contains a bunch of helper functions useful for traversing Enumerations.
In my plugin, I'm referencing System.Linq in a using statement and then trying to use a .Where(x=>x....) clause, but on Enabling the plugin, I'm met with this error:
'System.Collections.Generic.IList<Advanced_Combat_Tracker.CombatantData>' does not contain a definition for 'Where' and no extension method 'Where' accepting a first argument of type 'System.Collections.Generic.IList<Advanced_Combat_Tracker.CombatantData>' could be found (are you missing a using directive or an assembly reference?)
I've taken a look into your PluginListingPanel.cs, and can see that the CompilerParameters contains a referenced assembly line for "System.Linq.dll", and I assume ACT itself is using Linq for it's ordering (maybe it doesn't). I don't know if those CompilerParameters also needs to contain a reference to "System.Core.dll"?
To reproduce, just create a plugin that has the System.Linq using statement, and get it to do some simple Linq statement, such as below, and see what happens when you enable the plugin.
var list = new List<int> { 1, 2, 3 };