MscrmTools / MsCrmTools.WebResourcesManager

Manage your web resources easily
GNU General Public License v3.0
15 stars 20 forks source link

File locking issue in local file management #68

Open VanPuyveldeKevin opened 6 years ago

VanPuyveldeKevin commented 6 years ago

Issues getting the folder synced locally ... once started updating, refreshing results in a critical error. Even if no pending changes were present I still managed to get this 'locked file' error just by trying various options for getting the application to accept local synced file path. Locker is the application itself though, so it shouldn't make itself crash.

Manually deleting all files via Windows Explorer works as a work around, but isn't exactly ... clean.

NOTE: Updating the downloaded files, then receiving an exception and undoing the pending changes to start over -> 0 pending changes + Locked folder/files trying to 'refresh' (since ... who knows what broke due to said exception)

************** Exception Text **************
System.UnauthorizedAccessException: Access to the path 'C:\Temp\Temp\apps\general\Folder\Control.html' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.File.InternalWriteAllBytes(String path, Byte[] bytes, Boolean checkHost)
   at MscrmTools.WebresourcesManager.MyPluginControl.SaveToDisk(IEnumerable`1 resources, Boolean withRoot)
   at System.Windows.Forms.ToolStripDropDownItem.OnDropDownItemClicked(ToolStripItemClickedEventArgs e)
   at System.Windows.Forms.ToolStrip.OnItemClicked(ToolStripItemClickedEventArgs e)
   at System.Windows.Forms.ToolStripDropDown.OnItemClicked(ToolStripItemClickedEventArgs e)
   at System.Windows.Forms.ToolStrip.HandleItemClick(ToolStripItem dismissingItem)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Lock Issue.txt

MscrmTools commented 6 years ago

I will have a look. Thanks for reporting the issue