I think the problem we are facing might be a memory allocation issue.
After posting the response to your questions from yesterday I decided to reinstall NCrunch just encase I had managed to corrupt my copy some how (grasping at straws here), after uninstalling NCrunch I remembered that ReSharper (which I run) had a test runner built into it that would run NUnit tests so I fired that up. It ran my tests and reported 153 failing tests, they were all failing for the same two reasons. It appears to me that the ReSharper test runner doesn't honour the <Appartment(ApartmentState.STA)> attribute or deal with VB's My.Resources or My.Settings functionality as every test failure was caused by one of these two reasons. I could add and remove tests as I needed to and it reported the same tests failing for the same reasons each run so it seamed happy enough to execute my test suit disregarding it's shortcomings.
I reinstalled NCrunch and started deleting test until NCrunch was happy to play nicely again and set NCrunch going on endless churn. It started to fail tests and finally topped out at 202 failing tests but this time I got, in the Trace Output, a error message for each failed test and they are all the same exception 'System.ComponentModel.Win32Exception: Not enough memory resources are available to process this command'. I opened the Resource Monitor and set NCrunch going again. This time it failed 86 tests giving the same exception. My machine has 32GB of ram and the resource monitor showed that I never used even half of what's available so I don't think?? it's my machine, could it be some allocation issue inside of NCrunch or NUnit? Below is an example Trace Output for a failed test.
Expected: No Exception to be thrown
But was: <System.Windows.Markup.XamlParseException: 'Add value to collection of type 'System.Windows.Controls.UIElementCollection' threw an exception.' Line number '39' and line position '18'. ---> System.ComponentModel.Win32Exception: Not enough memory resources are available to process this command
at MS.Win32.UnsafeNativeMethods.RegisterClassEx(WNDCLASSEX_D wc_d)
at MS.Win32.HwndWrapper..ctor(Int32 classStyle, Int32 style, Int32 exStyle, Int32 x, Int32 y, Int32 width, Int32 height, String name, IntPtr parent, HwndWrapperHook[] hooks)
at System.Windows.Media.MediaContextNotificationWindow..ctor(MediaContext ownerMediaContext)
at System.Windows.Media.MediaContext..ctor(Dispatcher dispatcher)
at System.Windows.Media.MediaContext.From(Dispatcher dispatcher)
at System.Windows.Media.Visual.VerifyAPIReadWrite()
at System.Windows.Media.VisualCollection.Add(Visual visual)
at System.Windows.Controls.UIElementCollection.AddInternal(UIElement element)
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.Add(Object collection, XamlType collectionType, Object value, XamlType valueXamlType)
--- End of inner exception stack trace ---
at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at PowderkegSoftware.Archimedes.Workspaces.Machining.MachiningWorkspaceView.InitializeComponent() in D:\Workshop\Archimedes\UI\Workspaces\Machining\MachiningWorkspaceView.xaml:line 1
at PowderkegSoftware.Archimedes.Workspaces.Machining.MachiningWorkspaceView..ctor()
at PowderkegSoftware.Archimedes.Workspaces.Machining.MachiningWorkspaceFactory.InstantiateMvvmComponents() in D:\Workshop\Archimedes\Artisan\Workspaces\Machining\MachiningWorkspaceFactory.vb:line 44
at PowderkegSoftware.Archimedes.Workspaces.Machining.MachiningWorkspaceFactory.Make() in D:\Workshop\Archimedes\Artisan\Workspaces\Machining\MachiningWorkspaceFactory.vb:line 15
at PowderkegSoftware.Archimedes.Workspaces.Machining.Tests.MachiningWorkspaceFactoryTests._Lambda$__2-0() in D:\Workshop\Archimedes\Tests\Workspaces\Machining\Construction\MachiningWorkspaceFactoryTests.vb:line 19
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at NUnit.Framework.Internal.ExceptionHelper.Rethrow(Exception exception)
at NUnit.Framework.Internal.Reflect.DynamicInvokeWithTransparentExceptions(Delegate delegate)
at NUnit.Framework.Internal.ExceptionHelper.RecordException(Delegate parameterlessDelegate, String parameterName)>
at PowderkegSoftware.Archimedes.Workspaces.Machining.Tests.MachiningWorkspaceFactoryTests.GivenMake_WhenInvoked_ThenDoesNotThrow() in D:\Workshop\Archimedes\Tests\Workspaces\Machining\Construction\MachiningWorkspaceFactoryTests.vb:line 19