So I started to work with C# and I would like to read an xml file using XmlDocument (System.Xml). I have the file in the project structure under Assets/XmlFiles. In GDscript the path would be res://Assets/XmlFiles/file.xml. But that doesn't seem to work in C#. Is there a new path definition for C#?

Here is the error im getting

My guess is since Godot doesn't know anything about XmlDocument, it breaks when you try to use it as a resource. You can't really mix Godot types with external types. You probably need to open the file with Godot's File class to read its contents and pass the data to the C# classes.

Thats the conclusion I came to also. I do like your work around, Ill try it out. Thank you for the help.

@vnen said: My guess is since Godot doesn't know anything about XmlDocument, it breaks when you try to use it as a resource. You can't really mix Godot types with external types. You probably need to open the file with Godot's File class to read its contents and pass the data to the C# classes.

10 days later

Just as an update to this, everything works now in C#. Im not sure what I did or if it was fixed in the new updates. But C# works as expected. Although its still quirky. Im loving C# in Godot.

5 years later