I'm having the following error in the unity console:
IOException: Sharing violation on path /Users/carlos/_Personal/Development/Unity3d/B2BUnity1/Assets/Documents/Profiles.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, FileAccess access, FileShare share) (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare) System.Xml.XmlTextWriter..ctor (System.String filename, System.Text.Encoding encoding) ProfileManager.StoreProfiles (System.Collections.ArrayList profilesList) (at Assets/Scripts/ProfileManager.cs:86) GUITouchScroll.OnGUI () (at Assets/Scripts/GUITouchScroll.cs:113)
And the code at ProfileManager.cs:86
public void StoreProfiles(ArrayList profilesList) {
// Create a new file specified path
XmlTextWriter textWriter = new XmlTextWriter(profilesPath, null); // 86
// Opens the document
textWriter.WriteStartDocument();
Code at GUITouchScroll.cs:113
ProfileManager profileMan = plane.GetComponent("ProfileManager") as ProfileManager;
profileMan.profilesPath = Application.dataPath + "/Documents/Profiles.xml";
profileMan.StoreProfiles(list); //113
Is it possible that using Applicaction.dataPath is causing the problem? or maybe is it something related to XmlTextWriter?