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 /
avatar image
0
Question by leonida · Oct 19, 2012 at 12:16 PM · editorbuildxmlread

read XML work in editor but not in final build

hello, using this code in the editor i can read the xml file (located in the project folder). In the build the file is not read

What's wrong?

 import System.Xml;
 
 var Filename="gamexml.xml";
 
 var test="Hello"; 
 
     function Start()
     
     {
        
 var reader:XmlReader = XmlReader.Create(Filename);
 
   while(reader.Read())  {
              if(reader.IsStartElement("TestUp"))  {
                 test=reader.GetAttribute("Test");
               }         
         }
      }
  


here's the output_log of the build

 GfxDevice: creating device client; threaded=1
 Direct3D:
     Version:  Direct3D 9.0c [aticfx64.dll 8.17.10.1140]
     Renderer: ATI Radeon HD 5800 Series
     Vendor:   ATI
     VRAM:     1010 MB (via DXGI)
     Caps:     Shader=30 DepthRT=1 NativeDepth=1 NativeShadow=1 DF16=1 DF24=1 INTZ=1 RAWZ=0 NULL=1 RESZ=1 SlowINTZ=1
 <I> Initializing (RawInput).
 
 <RI> Input initialized.
 
 desktop: 1680x1050 60Hz; virtual: 3360x1050 at 0,0
 Begin MonoManager ReloadAssembly
 Platform assembly: C:\Users\Pc\Desktop\try\231012\try_Data\Managed\UnityEngine.dll (this message is harmless)
 Loading C:\Users\Pc\Desktop\try\231012\try_Data\Managed\UnityEngine.dll into Unity Child Domain
 Platform assembly: C:\Users\Pc\Desktop\try\231012\try_Data\Managed\Assembly-CSharp-firstpass.dll (this message is harmless)
 Loading C:\Users\Pc\Desktop\try\231012\try_Data\Managed\Assembly-CSharp-firstpass.dll into Unity Child Domain
 Platform assembly: C:\Users\Pc\Desktop\try\231012\try_Data\Managed\Assembly-CSharp.dll (this message is harmless)
 Loading C:\Users\Pc\Desktop\try\231012\try_Data\Managed\Assembly-CSharp.dll into Unity Child Domain
 Platform assembly: C:\Users\Pc\Desktop\try\231012\try_Data\Managed\Assembly-UnityScript-firstpass.dll (this message is harmless)
 Loading C:\Users\Pc\Desktop\try\231012\try_Data\Managed\Assembly-UnityScript-firstpass.dll into Unity Child Domain
 Platform assembly: C:\Users\Pc\Desktop\try\231012\try_Data\Managed\Assembly-UnityScript.dll (this message is harmless)
 Loading C:\Users\Pc\Desktop\try\231012\try_Data\Managed\Assembly-UnityScript.dll into Unity Child Domain
 Platform assembly: C:\Users\Pc\Desktop\try\231012\try_Data\Managed\System.Xml.dll (this message is harmless)
 Loading C:\Users\Pc\Desktop\try\231012\try_Data\Managed\System.Xml.dll into Unity Child Domain
 - Completed reload, in  0.105 seconds
 Platform assembly: C:\Users\Pc\Desktop\try\231012\try_Data\Managed\UnityScript.Lang.dll (this message is harmless)
 Platform assembly: C:\Users\Pc\Desktop\try\231012\try_Data\Managed\Boo.Lang.dll (this message is harmless)
 The referenced script on this Behaviour is missing!
  
 (Filename: C:/BuildAgent/work/b0bcff80449a48aa/Runtime/Mono/MonoBehaviour.cpp Line: 1576)
 
 The class defined in script file named 'ExcelReader' does not match the file name!
  
 (Filename: C:/BuildAgent/work/b0bcff80449a48aa/Runtime/Mono/MonoBehaviour.cpp Line: 1482)
 
 Platform assembly: C:\Users\Pc\Desktop\try\231012\try_Data\Managed\System.dll (this message is harmless)
 SecurityException: file:// URIs not allowed
   at System.Xml.XmlUrlResolver.GetEntity (System.Uri absoluteUri, System.String role, System.Type ofObjectToReturn) [0x00000] in <filename unknown>:0 
 
   at Mono.Xml2.XmlTextReader.GetStreamFromUrl (System.String url, System.String& absoluteUriString) [0x00000] in <filename unknown>:0 
 
   at Mono.Xml2.XmlTextReader..ctor (Boolean dummy, System.Xml.XmlResolver resolver, System.String url, XmlNodeType fragType, System.Xml.XmlParserContext context) [0x00000] in <filename unknown>:0 
 
   at System.Xml.XmlTextReader..ctor (Boolean dummy, System.Xml.XmlResolver resolver, System.String url, XmlNodeType fragType, System.Xml.XmlParserContext context) [0x00000] in <filename unknown>:0 
 
   at System.Xml.XmlReader.Create (System.String url, System.Xml.XmlReaderSettings settings, System.Xml.XmlParserContext context) [0x00000] in <filename unknown>:0 
 
   at System.Xml.XmlReader.Create (System.String url, System.Xml.XmlReaderSettings settings) [0x00000] in <filename unknown>:0 
 
   at System.Xml.XmlReader.Create (System.String url) [0x00000] in <filename unknown>:0 
 
   at ReadXML.Start () [0x00000] in <filename unknown>:0 
  
 (Filename:  Line: -1)
 
 FormatException: Unknown char: N
   at System.Double.Parse (System.String s, NumberStyles style, IFormatProvider provider) [0x00000] in <filename unknown>:0 
 
   at System.Single.Parse (System.String s) [0x00000] in <filename unknown>:0 
 
   at UnityScript.Lang.UnityBuiltins.parseFloat (System.String value) [0x00000] in <filename unknown>:0 
 
   at profondita+$Start$37+$.MoveNext () [0x00000] in <filename unknown>:0 
  
 (Filename:  Line: -1)
 
 Running as server. Player ID is 0.
  
 (Filename: C:/BuildAgent/work/b0bcff80449a48aa/Runtime/Network/NetworkManager.cpp Line: 2479)
 


i noticed this error

" SecurityException: file:// URIs not allowed"

How to solve?

Comment
Add comment · Show 1
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
avatar image Graham-Dunnett ♦♦ · Oct 19, 2012 at 12:19 PM 0
Share

In the build, where are you trying to read the file from?

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Graham-Dunnett · Oct 19, 2012 at 12:18 PM

If your build is a web player, then you have no access to the hard drive.

Comment
Add comment · Show 1 · Share
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
avatar image leonida · Oct 20, 2012 at 03:44 PM 0
Share

thank you, but my build is standard Windows

avatar image
0

Answer by leonida · Oct 23, 2012 at 01:12 PM

solved. I've systemXML.dll copied to the project folder.works after elimination.

Comment
Add comment · Share
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

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

10 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

Related Questions

Distribute terrain in zones 3 Answers

Get external .xml in mobile 1 Answer

read an excel file works only in the editor,not in the build 2 Answers

how to include resources to build? -1 Answers

Script works in editor, but does not work in build (Android) 1 Answer


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