- Home /
Question by
diddykonga · Aug 21, 2011 at 05:30 AM ·
xmlpathfilestream
Stream Writer cant find part of path
Hello, the problem i am having is when i try to use my Stream Writer to make my XML file it says it cant find part of the path, heres the code.
XmlSerializer serial = new XmlSerializer(typeof(Combo));
FileStream fileStream = new FileStream(@"Combos\"+combo.Name+".xml", FileMode.Create);
serial.Serialize(fileStream, combo);
Heres the error
DirectoryNotFoundException: Could not find a part of the path"C:\Users\Admin\Desktop\Battle Brawl\Combos\Name.xml".
System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options)
System.IO.FileStream..ctor (System.String path, FileMode mode)
(wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode)
ComboCreator.OnGUI () (at Assets/Editor/ComboCreator.cs:108)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
Comment
I hate to ask the bleeding obvious, but does the file folder "Combos" exist?
Yah i figure out i hadnt made the Combos folder yet, sorry i was up late and my $$anonymous$$d wasnt with me anymore XD
Your answer
Follow this Question
Related Questions
Filestream for XMLReader not working on iOS 1 Answer
XML doens't load in Unity Standalone 1 Answer
Access file with unknown path? 1 Answer
How to load a resource xml with XmlReader 1 Answer
Serialize XML File Delete and CreateNew 2 Answers