dotcomboom / AutoSite

Desktop static site generator
http://autosite.somnolescent.net
MIT License
31 stars 2 forks source link

Exception when creating new-page.md when it already exists #11

Closed mariteaux closed 5 years ago

mariteaux commented 5 years ago

If you have a page literally called new-page.md, build your site, and then try to add another page. you get an exception. This only happens immediately after building, and only with Markdown files; HTML files will append the (1), (2), etc when you already have a page with that name. Oddly, if you have an HTML file with the same name, the new Markdown file can be made and will have a number appended to it.

Here's the details if that helps any.

************** Exception Text **************
System.IO.IOException: The process cannot access the file 'C:\Users\mariteaux\Desktop\autosite\in\new-page.md' because it is being used by another process.
   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)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize)
   at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding)
   at Microsoft.VisualBasic.FileIO.FileSystem.WriteAllText(String file, String text, Boolean append, Encoding encoding)
   at Microsoft.VisualBasic.MyServices.FileSystemProxy.WriteAllText(String file, String text, Boolean append)
   at AutoSite_XL.Form1.NewMDCon_Click(Object sender, EventArgs e)
   at System.Windows.Forms.MenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.Command.Invoke()
   at System.Windows.Forms.Control.WmCommand(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.TreeView.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.9145 (WinRelRS6.050727-9100)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
AutoSite XL
    Assembly Version: 0.9.3.0
    Win32 Version: 0.0.0.0
    CodeBase: file:///C:/Users/mariteaux/Downloads/AutoSite.XL.0.9.3/AutoSite%20XL.exe
----------------------------------------
Microsoft.VisualBasic
    Assembly Version: 8.0.0.0
    Win32 Version: 8.0.50727.9136 (WinRelRS6.050727-9100)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.9145 (WinRelRS6.050727-9100)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.9136 (WinRelRS6.050727-9100)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.9136 (WinRelRS6.050727-9100)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Runtime.Remoting
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.9136 (WinRelRS6.050727-9100)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.9136 (WinRelRS6.050727-9100)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.9136 (WinRelRS6.050727-9100)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
FastColoredTextBox
    Assembly Version: 2.16.26.0
    Win32 Version: 2.16.26.0
    CodeBase: file:///C:/Users/mariteaux/Downloads/AutoSite.XL.0.9.3/FastColoredTextBox.DLL
----------------------------------------
CommonMark
    Assembly Version: 0.1.0.0
    Win32 Version: 0.1.0.0
    CodeBase: file:///C:/Users/mariteaux/Downloads/AutoSite.XL.0.9.3/CommonMark.DLL
----------------------------------------
dotcomboom commented 5 years ago

Fixed with https://github.com/dotcomboom/AutoSite-XL/commit/717650635417ba27d158abae2050b2668f5f4118