Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

pretzel taste throws PlatformNotSupportedException as global tool when a file is changed #364

Open
biohazard999 opened this issue Dec 11, 2019 · 0 comments

Comments

@biohazard999
Copy link
Contributor

Describe the bug
When using pretzel taste an PlatformNotSupportedException is thrown

Unhandled Exception: System.PlatformNotSupportedException: Thread abort is not supported on this platform.
   at System.Threading.Thread.Abort()
   at Pretzel.Logic.Win32Processes.GetFilesLockedBy(Process process) in C:\F\github\pretzel\src\Pretzel.Logic\SanityCheck.cs:line 74
   at Pretzel.Logic.Win32Processes.GetProcessesLockingFile(String filePath) in C:\F\github\pretzel\src\Pretzel.Logic\SanityCheck.cs:line 37
   at Pretzel.Logic.SanityCheck.IsLockedByAnotherProcess(String file) in C:\F\github\pretzel\src\Pretzel.Logic\SanityCheck.cs:line 18
   at Pretzel.Logic.Templating.Context.SiteContextGenerator.SafeReadLine(String file) in C:\F\github\pretzel\src\Pretzel.Logic\Templating\Context\SiteContextGenerator.cs:line 355
   at Pretzel.Logic.Templating.Context.SiteContextGenerator.BuildPages(IConfiguration config, SiteContext context)+MoveNext() in C:\F\github\pretzel\src\Pretzel.Logic\Templating\Context\SiteContextGenerator.cs:line 91
   at System.Collections.Generic.List`1.AddEnumerable(IEnumerable`1 enumerable)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Pretzel.Logic.Templating.Context.SiteContextGenerator.BuildContext(String path, String destinationPath, Boolean includeDrafts) in C:\F\github\pretzel\src\Pretzel.Logic\Templating\Context\SiteContextGenerator.cs:line 62
   at Pretzel.Logic.Commands.TasteCommand.WatcherOnChanged(String file, TasteCommandArguments arguments) in C:\F\github\pretzel\src\Pretzel.Logic\Commands\TasteCommand.cs:line 169
   at Pretzel.Logic.Modules.SimpleFileSystemWatcher.WatcherOnChanged(Object sender, FileSystemEventArgs args) in C:\F\github\pretzel\src\Pretzel.Logic\Modules\SimpleFileSystemWatcher.cs:line 50
   at System.IO.FileSystemWatcher.NotifyFileSystemEventArgs(WatcherChangeTypes changeType, String name)
   at System.IO.FileSystemWatcher.ParseEventBufferAndNotifyForEach(Byte[] buffer)
   at System.IO.FileSystemWatcher.ReadDirectoryChangesCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* overlappedPointer)
   at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

To Reproduce
Steps to reproduce the behavior:

  1. Create a liquid project
  2. run pretzel taste
  3. change a file and hit save
  4. Exception is thrown an pretzel dies

Expected behavior
pretzel taste should work as expected

Desktop (please complete the following information):

  • OS: Windows
  • Version current master
  • Run as global tool with netcore 3.0 runtime (not sure if it dies on netcore 2.2)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant