Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by nathious9536 · Mar 08, 2021 at 10:04 PM · android buildoculusdebuggingplayer settingsxmlserializer

Exception caught when deserializing a .xml: Failed to load configuration section for dataContractSerializer

TLDR: I'm building to my Oculus Quest 2 and received an error: "Failed to load configuration section for dataContractSerializer" I found a site that said to change my api compatibility but Unity won't let me switch it.

I'm currently working on building a game to the Oculus Quest 2. It builds and runs fine, but I'm having problems with deserializing data from a .xml file into the game. I'm using Application.streamingAssetsPath and UnityWebRequest because of the whole .jar problems with androids, and I'm temporarily using the same method in the Unity Editor for debugging purposes. It works fine in the editor but gives an error on the Quest 2. Here is my code:

 DataContractSerializer serializer = new DataContractSerializer(typeof(CoreData));
 XmlDictionaryReader reader = null;
 CoreData coreData = null;
 UnityWebRequest webRequest = null;
     
 try
 {
     webRequest = UnityWebRequest.Get(filePath);
     webRequest.SendWebRequest();
     while (!webRequest.downloadHandler.isDone) { }
                     
     Console.WriteLine(webRequest.downloadHandler.text); //prints out the text in the .xml
 
     //deserialize 
     reader = XmlDictionaryReader.CreateTextReader(webRequest.downloadHandler.data, new XmlDictionaryReaderQuotas());
     coreData = serializer.ReadObject(reader, true) as CoreData;
     
     if (coreData != null)
             outCoreObj.SetSerializedData(coreData);
 }
 //catch and finally statement

I'm using the command prompt with adb for debugging and it's able to print out the text inside of the xml file, but the catch block is still printing out this error when it tries to deserialize the data from the web request

 Failed to load configuration section for dataContractSerializer

I'm honestly at a loss at this point. I know there's nothing wrong with the file path, I know it's retrieving the data from the xml file in the web request, but it catches an error on the "coreData = serializer.ReadObject(reader, true) as CoreData" line (which could also be a problem from the line above it).

The only answer I've been able to find is this. Their error looks slightly different, but I tried switching my API compatibility to 2.0 from 4.x and adding the link.xml anyways, but when I tried to switch the api compatibility, it didn't work. Basically, I clicked 2.0, it started loading, then once it finished loading it switched back to 4.x. I don't know anything about .NET stuff though so maybe there's an obvious reason for that.

If anyone could provide any advice on how to either get rid of this error or switch my API compatibility so I can test that method, I would be extremely thankful. I've been stuck on this problem for a while now.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

161 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

GearVR camera shaking/Jittering 1 Answer

Android build installs without an icon in the app drawer 2 Answers

Keystore Problem 0 Answers

App not showing up on Oculus Go - build from Unity 2019 1 Answer

Can't run APK, after launch just black screen. Any suggestions what I can do? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges