Pipeline tool has crashed

I’ve been trying to get MonoGame to run on a fresh install of Visual Studio 2017. However, the content pipeline tool is giving me problems with my project. When I try to save the build, regardless of what I do, it always gives me the following error:

System.UnauthorizedAccessException: Access to the path is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count)
   at System.IO.FileStream.FlushWrite(Boolean calledFromFinalizer)
   at System.IO.FileStream.Dispose(Boolean disposing)
   at System.IO.Stream.Close()
   at System.IO.StreamWriter.Dispose(Boolean disposing)
   at System.IO.TextWriter.Dispose()
   at MonoGame.Tools.Pipeline.PipelineProjectParser.SaveProject()
   at MonoGame.Tools.Pipeline.PipelineController.SaveProject(Boolean saveAs)
   at Eto.Forms.Command.OnExecuted(EventArgs e)
   at Eto.Forms.Command.System.Windows.Input.ICommand.Execute(Object parameter)
   at Eto.Forms.ToolItem.OnClick(EventArgs e)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at System.Windows.Controls.Button.OnClick()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at MonoGame.Tools.Pipeline.Program.Main(String[] args)

Is the tool located in a protected folder by any chance? It looks like it doesn’t have permission writing to the path.

Ok I finally realised what was going on, I just use Windows firewall but I had ‘ransomware protection’ option turned on. As soon as I turned it off everything started working fine again.

1 Like

Documents folder? Source folder? Where? it doesn’t help neither yourself nor others if you don’t point these basic things out. I ask because by default random folder access is restricted especially in most C:\ directories.

And you mean the inbuilt ransomware protection in Windows Security, right? do you mean Controlled Folder Access? it’s off by default [Or my third party software disabled it], are you the only user on that machine? [ Pretty sure it is off by default; based on this article: https://docs.microsoft.com/en-us/windows/security/threat-protection/windows-defender-exploit-guard/enable-controlled-folders-exploit-guard ]

Just want to point these factors out as what you are suggesting can and most likely is dangerous for inexperienced users.

Not angry, though it may come across that way, just a bit concerned about the nonchalant manner of the posts here.

Keep coding!

You will have to excuse any negligence in my posting, I’m not a professional developer.

Yes I am referring to the ‘Controlled Folder Access’ of the inbuilt ransomware protection in Windows Security.

I am not the only user of the device, a family member had switched it on.

I don’t mean to be nonchalant, just thought it would be helpful to point out that this was what was causing the problems.

The Visual Studio project is based C:\Users[name]\Documents\Visual Studio 2017\Projects folder if that is helpful?

1 Like

I figured this out :laughing:

Not to worry, just wanted to ensure it was not confused by a less experienced user and misinterpreted leading to severe consequences in case they though disabling any ransomware software as a fix and never turning it back on, even though this is entirely unrelated to ransomware and more a sub feature…

Glad you got it sorted however, might want to ask who turned it on and for what reason, and you can show them that it is there for specific purposes as outlined in the above article.

Keep coding :slight_smile: