1
Vote

Using DirectX rendersystems throws a TypeInitializationException

description

The error is in both latest source and version 0.5


{"Couldn't get default RenderSystem 'DirectX 10' because it was not found in the list of registered creators!"}


The type initializer for 'ANX.Framework.Graphics.GraphicsAdapter' threw an exception.




at ANX.Framework.Graphics.GraphicsAdapter.get_DefaultAdapter()
at ANX.Framework.GraphicsDeviceInformation..ctor()
at ANX.Framework.GraphicsDeviceManager.FindBestDevice(Boolean anySuitableDevice)
at ANX.Framework.GraphicsDeviceManager.ApplyChanges()
at ANX.Framework.GraphicsDeviceManager.CreateDevice()
at ANX.Framework.Game.RunGame()
at ANX.Framework.Game.Run()
at SimGen.Form1.Button2_Click(Object sender, EventArgs e) in C:\Users\Alastair W. Bennett\Documents\Visual Studio 2010\Projects\SimGen\SimGen\Form1.vb:line 22
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at SimGen.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

comments

KorsarNek wrote Jan 12, 2014 at 3:07 PM

The AddIn System probably didn't find the directx10 render system because the assembly for it (ANX.RenderSystem.Windows.DX10.dll) wasn't in the same Directory as the executing assembly and it was not registered in the GAC. It searches both places and if it finds it in one of them, it tries to load it. But it looks like late loading the assembly doesn't work and it also doesn't work if you have the assembly already in memory but not in one of the two places because of a weird setup like I'm using it. For the last case, I could probably upload a patch.