When compiling in Visual Studio 2013, FSharp.Data version="2.2.0" targetFramework="net45".
This works only when foo.xml is in the same directory where the executable file built. Runtime current directory seems not to have any effect. Setting "Working directory" in project properties or changing the current directory with Directory.SetCurrentDirectory is ignored.
type NamesDotXml = XmlProvider<"<items><item weight='10'>James</item></items>">
let loadNames (filename:string) = NamesDotXml.Load(filename).Items
let n = loadNames("foo.xml")
Workaround, this works as expected, foo.xml is correctly found in the current directory. Both the Working Directory project setting and a runtime change with Directory.SetCurrentDirectory are respected:
type NamesDotXml = XmlProvider<"<items><item weight='10'>James</item></items>">
let loadNames (filename:string) = NamesDotXml.Load(System.IO.File.OpenText(filename)).Items
let n = loadNames("foo.xml")
When compiling in Visual Studio 2013, FSharp.Data version="2.2.0" targetFramework="net45".
This works only when
foo.xmlis in the same directory where the executable file built. Runtime current directory seems not to have any effect. Setting "Working directory" in project properties or changing the current directory withDirectory.SetCurrentDirectoryis ignored.Workaround, this works as expected,
foo.xmlis correctly found in the current directory. Both the Working Directory project setting and a runtime change withDirectory.SetCurrentDirectoryare respected: