Windows Forms loading effects

Hello everyone,

I am using Windows Forms controls as with this solution: Two Windows Forms controls on one form This works fine. I am also using a content manager like this:

services = new GameServiceContainer();
services.AddService(typeof(IGraphicsDeviceService), graphics);
content = new ContentManager(services);

Now problems occur when I try to load an effect. The problem occurs in Shader.DirectX.cs in CreatePixelShader(). This is the exception detail:

SharpDX.SharpDXException was unhandled
_HResult=-2147024809
_message=HRESULT: [0x80070057], Module: [General], ApiCode: [E_INVALIDARG/Invalid Arguments], Message: Falscher Parameter.

HResult=-2147024809
IsTransient=false
Message=HRESULT: [0x80070057], Module: [General], ApiCode: [E_INVALIDARG/Invalid Arguments], Message: Falscher Parameter.

Source=SharpDX
StackTrace:
bei SharpDX.Result.CheckError()
bei SharpDX.Direct3D11.Device.CreatePixelShader(IntPtr shaderBytecodeRef, PointerSize bytecodeLength, ClassLinkage classLinkageRef, PixelShader pixelShaderOut)
bei SharpDX.Direct3D11.PixelShader…ctor(Device device, Byte[] shaderBytecode, ClassLinkage linkage)
bei Microsoft.Xna.Framework.Graphics.Shader.CreatePixelShader() in E:\MonoGame\MonoGame.Framework\Graphics\Shader\Shader.DirectX.cs:Zeile 75.
bei Microsoft.Xna.Framework.Graphics.Shader.PlatformConstruct(BinaryReader reader, Boolean isVertexShader, Byte[] shaderBytecode) in E:\MonoGame\MonoGame.Framework\Graphics\Shader\Shader.DirectX.cs:Zeile 52.
bei Microsoft.Xna.Framework.Graphics.Shader…ctor(GraphicsDevice device, BinaryReader reader) in E:\MonoGame\MonoGame.Framework\Graphics\Shader\Shader.cs:Zeile 93.
bei Microsoft.Xna.Framework.Graphics.Effect.ReadEffect(BinaryReader reader) in E:\MonoGame\MonoGame.Framework\Graphics\Effect\Effect.cs:Zeile 302.
bei Microsoft.Xna.Framework.Graphics.Effect…ctor(GraphicsDevice graphicsDevice, Byte[] effectCode) in E:\MonoGame\MonoGame.Framework\Graphics\Effect\Effect.cs:Zeile 112.
bei Microsoft.Xna.Framework.Content.EffectReader.Read(ContentReader input, Effect existingInstance) in E:\MonoGame\MonoGame.Framework\Content\ContentReaders\EffectReader.cs:Zeile 36.
bei Microsoft.Xna.Framework.Content.ContentTypeReader1.Read(ContentReader input, Object existingInstance) in E:\MonoGame\MonoGame.Framework\Content\ContentTypeReader.cs:Zeile 181. bei Microsoft.Xna.Framework.Content.ContentReader.InnerReadObject[T](T existingInstance) in E:\MonoGame\MonoGame.Framework\Content\ContentReader.cs:Zeile 175. bei Microsoft.Xna.Framework.Content.ContentReader.ReadObject[T](T existingInstance) in E:\MonoGame\MonoGame.Framework\Content\ContentReader.cs:Zeile 162. bei Microsoft.Xna.Framework.Content.ContentReader.ReadObject[T]() in E:\MonoGame\MonoGame.Framework\Content\ContentReader.cs:Zeile 150. bei Microsoft.Xna.Framework.Content.ContentReader.ReadAsset[T]() in E:\MonoGame\MonoGame.Framework\Content\ContentReader.cs:Zeile 72. bei Microsoft.Xna.Framework.Content.ContentManager.ReadAsset[T](String assetName, Action1 recordDisposableObject) in E:\MonoGame\MonoGame.Framework\Content\ContentManager.cs:Zeile 291.
bei Microsoft.Xna.Framework.Content.ContentManager.Load[T](String assetName) in E:\MonoGame\MonoGame.Framework\Content\ContentManager.cs:Zeile 206.
bei LIB.RenderHelper.Initialize(ContentManager content) in E:\Aphrodite\Aphrodite\LIB\Lighting\RenderHelper.cs:Zeile 32.
bei LIB.EditorEngine.SetRoot(String path) in E:\Aphrodite\Aphrodite\MapEditor\EditorEngine.cs:Zeile 59.
bei MapEditor.MainForm.loadTilesetToolStripMenuItem_Click(Object sender, EventArgs e) in E:\Aphrodite\Aphrodite\MapEditor\MainForm.cs:Zeile 250.
bei System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
bei System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
bei System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
bei System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
bei System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
bei System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
bei System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
bei System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
bei System.Windows.Forms.ToolStrip.WndProc(Message& m)
bei System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.Run(Form mainForm)
bei MapEditor.Program.Main() in E:\Aphrodite\Aphrodite\MapEditor\Program.cs:Zeile 17.
bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
bei System.AppDomain.nExecuteAssembly(RuntimeAssembly assembly, String[] args)
bei System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
bei System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
bei System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
bei System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
bei System.Activator.CreateInstance(ActivationContext activationContext)
bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Threading.ThreadHelper.ThreadStart()
InnerException:

Any help would be apreciated.

Thanks a lot,
Christian