- Home /
Can't save script
Hi again everyone,
I've been running into a new issue since upgrading to 4.3, and didn't know if it's a known problem / bug / user mess up. Often, when I make an edit to a script and want to save it monodevelop will spit out an error and not let me save. If I save under a different name, all's well, except that then I can't delete the name of the original file and change the name of the new one to the original in Unity. Am perplexed as to what's going on. Any help is appreciated. God bless.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.IOException: The process cannot access the file because it is being used by another process.
atSystem.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.__Error.WinIOError()at System.IO.File.Move(StringsourceFileName, String destFileName)
atMono.TextEditor.Utils.TextFileUtility.SystemRename(String sourceFile, String destFile) in c:\BuildAgent\work\9ffd76bfa3f1a926\monodevelop\main\src\core\Mono.Texteditor\Mono.TextEditor.Utils\TextFileUtility.cs:line 206
atMono.TextEditor.Utils.TextFileUtility.WriteText(String fileName, String text, Encoding encoding, Boolean hadBom) in c:\BuildAgent\work\9ffd76bfa3f1a926\monodevelop\main\src\core\Mono.Texteditor\Mono.TextEditor.Utils\TextFileUtility.cs:line 193
atMonoDevelop.SourceEditor.SourceEditorView.Save(String fileName, Encoding encoding) in c:\BuildAgent\work\9ffd76bfa3f1a926\monodevelop\main\src\addins\MonoDevelop.SourceEditor2\MonoDevelop.SourceEditor\SourceEditorView.cs:line 672
atMonoDevelop.SourceEditor.SourceEditorView.Save(String fileName) in c:\BuildAgent\work\9ffd76bfa3f1a926\monodevelop\main\src\addins\MonoDevelop.SourceEditor2\MonoDevelop.SourceEditor\SourceEditorView.cs:line 588
atMonoDevelop.Ide.Gui.Document.Save() in c:\BuildAgent\work\9ffd76bfa3f1a926\monodevelop\main\src\core\MonoDevelop.Ide\MonoDevelop.Ide.Gui\Document.cs:line 355
atMonoDevelop.Ide.Gui.ViewCommandHandlers.OnSaveFile() in c:\BuildAgent\work\9ffd76bfa3f1a926\monodevelop\main\src\core\MonoDevelop.Ide\MonoDevelop.Ide.Gui\ViewCommandHandlers.cs:line 65
--- End of inner exception stacktrace ---
atSystem.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
atSystem.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
atSystem.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
atSystem.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
atSystem.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
atMonoDevelop.Components.Commands.CommandHandlerInfo.Run(Object cmdTarget, Command cmd) in c:\BuildAgent\work\9ffd76bfa3f1a926\monodevelop\main\src\core\MonoDevelop.Ide\MonoDevelop.Components.Commands\CommandManager.cs:line 1922
atMonoDevelop.Components.Commands.CommandManager.c_DisplayClassb.b_2() in c:\BuildAgent\work\9ffd76bfa3f1a926\monodevelop\main\src\core\MonoDevelop.Ide\MonoDevelop.Components.Commands\CommandManager.cs:line 1045
atMonoDevelop.Components.Commands.CommandManager.DispatchCommand(Object commandId, Object dataItem, Object initialTarget, CommandSource source) in c:\BuildAgent\work\9ffd76bfa3f1a926\monodevelop\main\src\core\MonoDevelop.Ide\MonoDevelop.Components.Commands\CommandManager.cs:line 1062
Answer by Conect11 · Dec 28, 2013 at 05:21 PM
So, the answer is kind of silly. What happened is that MonoDevelop now allows the same script to open twice, in two tabs. Trying to save one with it open (and not changed) in another tab makes it go berzerk. There we have it. =)
Your answer