Xml loading

Hello,

I have implemented XML loading which works fine in the Unity IDE but when I run it on my iPhone I get the following error:

This error is being caused when I do the following:

public void Read(Stream pStream)
{
	XmlDocument pDoc = new XmlDocument();
	pDoc.Load(pStream);
}

I believe this is happening because XmlSchemaSet has been removed from the System.Xml.dll file but this is being called from another object and thus can not be found when the JIT tries to compile it.

Please let me know if this is a bug with Unity or whether I am doing something wrong.

Thanks

Possible reasons:

  1. It was not left out but is a feature that is part of .NET 2.0+. Unity iPhone is .NET 1.1
  2. If you own iPhone Basic, System.XML can not be used at all.
  3. If you have Unity iPhone Advanced and enable stripping it could potentially happen. But if you import the given parts it shouldn’t happen (only known exception so far is a stripping issue with the unityengine gui system which can be worked around by initiating an instance of a specific class that enforces inclusion of the whole part)

Hello,

XmlSchemaSet was added to .NET 2.0 but I’m not using XmlSchemaSet directly, I’m calling code which is allowed in .NET 1.1 so I wouldn’t have expected to get this error. If Unity is using Mono .NET 1.1 then how does it know about XmlSchemaSet since this object was added to .NET 2.0? I’m going by what the MSDN says about this object and its version information.

I am using the Advanced version and had to enable stripping because the project wouldn’t build since I was using System.Xml.dll. Stripping Level used is “Strip Assemblies”. When i disable Stripping, the following error is written to the console:

I understand this error and as such did what it suggested and enabled stripping. The only stripping option I can use is “Strip Assemblies”. The other options cause the monolinker to fail (can add the exception if required - it’s fairly long :P).

Thanks

Because the Editor is regular Unity which is .NET 2.0.
As the regular uses the assemblies for its own stuff as well (-> editor scripts etc), there are two seperate sets of assemblies.

The regular Mone ones and the MonoiPhone ones.

I don’t know which ones the editor live remote testing uses thought, would assume .NET 2.0 as the editor can not just switch between the .NET versions like that.

For that reasons its always important to do the real testing on the device. The live testing is only to balance settings and see if the setup basically works, if culling works as intend etc and naturally to attempt to get drawcall stats.

Hey,

After more testing, I have found the following:

  • Neither XPathDocument nor XmlDocument seem to load the XML stream.
  • XmlTextReader appears to load the stream containing the XML data.

I would greatly appreciate confirmation from Unity developers regarding this issue.

Thanks

Hi,
there were few issues with events/delegates that will be fixed with next Unity iPhone release. Please submit your project as a bug report and we will test on it too.