- Home /
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?
In the build, where are you trying to read the file from?
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.
Answer by leonida · Oct 23, 2012 at 01:12 PM
solved. I've systemXML.dll copied to the project folder.works after elimination.
Your answer
Follow this Question
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