Hi,
Can Wealth Lab Strategies include classes that come with System.Xml?
Thanks!
Size:
Color:
Size:
Color:
Thanks, that worked. I was adding "using System.Xml" to the top of the file under other using statements. That gave a compile error. I wonder what is the difference?
Size:
Color:
The difference is that the C# project (which your Strategy is too) is missing a reference to the assembly where the System.Xml namespace "lives in". By default, Wealth-Lab adds references to System, Windows.Forms (and maybe something else) transparently to the user, making it possible to include the using directives that you see in the default Strategy template.
Size:
Color:
Getting to using the Xml reference. Where can I insert the following line:
"XmlDocument CommonFile = null;"?
I checked the box: System.Xml in Editor > References.
- Inside namespace WealthLab.Strategies? error: CS0116, a namespace does not directly contain members such as fields or methods
- Inside public class MyStrategy : WealthScript? CS0246: The type or namespace name 'XmlDocument' could not be found (are you missing a using directive or an assembly reference?)
- Inside protected override void Execute()? same error
In all 3 cases 'XmlDocument' was not recognized and highlighted in blue.
Thanks
Size:
Color:
Take a careful look at the link above that contains a working example of XmlDocument usage.
Size:
Color:
Thanks, careful was the word.
In addition to checking the Xml box in editor > references, one must also add the line "using System.Xml" in the strategy file.
Size:
Color:
I should've highlighted it, but having taken a look at your post above (4/12/2012 12:34 AM) where you said it was included, reconsidered.
Size:
Color:
Sorry to bring old thread to life but I am facing issue in addling System.Xml
In the strategy editor I did select System.Xml in References... > .NET and clicked Ok but while adding Sysatem.Xml its giving the error that Xml does not exist in the namespace System. Is there any lib file I need to download and update somewhere?
Size:
Color:
You forgot to click OK or clicked Cancel in References.
Size:
Color:
I clicked OK, I also tried others like System.Transactions just to see but they are also showing same error.
Size:
Color:
Cannot reproduce in 6.9.23, NET 4.8. Could you attach a screenshot with using statements, checked References, and the compiler error?
Size:
Color:
Please find attached the screenshots, its still work in progress code.
Size:
Color:
Size:
Color: