Search Unity

System.XML Error When Building Player

Discussion in 'Windows' started by aidengaming123, Jul 28, 2013.

  1. aidengaming123

    aidengaming123

    Joined:
    Apr 19, 2013
    Posts:
    55
    HELP! :S
    I've been working on an Android project for a while now, and when 4.2 came out, I went ahead and grabbed a Windows Dev license. Earlier today I ran and tested my game on my Windows Phone and it ran perfectly, but now when ever I build and run the game, I get this error exclusively to Windows Phone: (Warning, Wall of Text)

    Error building Player: Exception: Error: type `System.Xml.XmlDocument` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlDocument` doesn't exist in target framework.
    Error: type `System.Xml.XmlDocument` doesn't exist in target framework.
    Error: type `System.Xml.XmlDocument` doesn't exist in target framework.
    Error: type `System.Xml.XmlDocument` doesn't exist in target framework.
    Error: type `System.Xml.XmlDocument` doesn't exist in target framework.
    Error: type `System.Xml.XmlDocument` doesn't exist in target framework.
    Error: type `System.Xml.XmlDocument` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNodeList` doesn't exist in target framework.
    Error: type `System.Xml.XmlNodeList` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNodeList` doesn't exist in target framework.
    Error: type `System.Xml.XmlNodeList` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNodeList` doesn't exist in target framework.
    Error: type `System.Xml.XmlNodeList` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNodeList` doesn't exist in target framework.
    Error: type `System.Xml.XmlNodeList` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlAttributeCollection` doesn't exist in target framework.
    Error: type `System.Xml.XmlAttributeCollection` doesn't exist in target framework.
    Error: type `System.Xml.XmlAttribute` doesn't exist in target framework.
    Error: type `System.Xml.XmlAttribute` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNodeList` doesn't exist in target framework.
    Error: type `System.Xml.XmlNodeList` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlAttributeCollection` doesn't exist in target framework.
    Error: type `System.Xml.XmlAttributeCollection` doesn't exist in target framework.
    Error: type `System.Xml.XmlAttribute` doesn't exist in target framework.
    Error: type `System.Xml.XmlAttribute` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNodeList` doesn't exist in target framework.
    Error: type `System.Xml.XmlNodeList` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlAttributeCollection` doesn't exist in target framework.
    Error: type `System.Xml.XmlAttributeCollection` doesn't exist in target framework.
    Error: type `System.Xml.XmlAttribute` doesn't exist in target framework.
    Error: type `System.Xml.XmlAttribute` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNodeList` doesn't exist in target framework.
    Error: type `System.Xml.XmlNodeList` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNodeList` doesn't exist in target framework.
    Error: type `System.Xml.XmlNodeList` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlAttributeCollection` doesn't exist in target framework.
    Error: type `System.Xml.XmlAttributeCollection` doesn't exist in target framework.
    Error: type `System.Xml.XmlAttribute` doesn't exist in target framework.
    Error: type `System.Xml.XmlAttribute` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Error: type `System.Xml.XmlNodeList` doesn't exist in target framework.
    Error: type `System.Xml.XmlNodeList` doesn't exist in target framework.
    Error: type `System.Xml.XmlNode` doesn't exist in target framework.
    Etc....

    Any ideas? Sdk problem?
     
    Last edited: Jul 28, 2013
  2. Kinerius

    Kinerius

    Joined:
    Jul 29, 2013
    Posts:
    5
    I have the same issue, anyone?
     
  3. mrdsmt

    mrdsmt

    Joined:
    Jul 28, 2012
    Posts:
    21
    Replace your current XML Parser with XDocument (System.Xml.Linq and System.Xml.Linq.XDocument), because of XMLDocument does not support on Windowphone Window store app (that use .NET 4.5).
     
    Last edited: Jul 30, 2013
  4. sxeanleedavid

    sxeanleedavid

    Joined:
    Apr 11, 2013
    Posts:
    3
    How do you replace this, simply drag/dropping file into place doesn't work. Besides a temporary hack, what would be the official way of fixing this so that Window Phone 8. apps. compile.

    Thank you,
    S
     
  5. gv

    gv

    Joined:
    Feb 22, 2013
    Posts:
    89
    You need to change the code and remove all the references to System.Xml.XmlDocument ... and also remove any .DLLs which might also be referencing that namespace..
     
  6. sxeanleedavid

    sxeanleedavid

    Joined:
    Apr 11, 2013
    Posts:
    3
    Thank you ! I'l try that. and update here how it goes. :)
     
  7. sxeanleedavid

    sxeanleedavid

    Joined:
    Apr 11, 2013
    Posts:
    3
    Okay, Now I'm getting this Error. LOL, typical Windows Development. Anyone have ideas on this ? How to fix ? Can't find this one any where:

    Error building Player: Exception: Error: type `System.Text.ASCIIEncoding` doesn't exist in target framework.


    Thanks in advance. :D
     
  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
  9. dupleg

    dupleg

    Joined:
    Sep 27, 2013
    Posts:
    1
    Im getting this error too! please tell me how to solve this problem. how do replace the XmlDocument references? and which files i need to edit? i tried google but couldnt find anything useful. Please help.
     
  10. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Your scripts, obviously. You can't use any of those unavailable classes.
     
  11. Roneesh

    Roneesh

    Joined:
    Jan 10, 2014
    Posts:
    7
    I have an issue. I am using xdocuments (using System.Xml.Linq), When i build it gives the error saying doc.save("FileName.xml") doesn't exist in target platform, any alternative solution for saving FileName.xml ???
     
  12. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
  13. Roneesh

    Roneesh

    Joined:
    Jan 10, 2014
    Posts:
    7
    Thank you very much. Its working.