我是在winForm窗體程序中添加media Player控件,之後一直添加不成功,添加過程如下:
遇到的錯誤是:
Microsoft Visual Studio
創建組件“AxHost”失敗。錯誤消息爲:
“System.Reflection.ReflectionTypeLoadException: 無法加載一個或多個請求的類型。有關更多信息,請檢索 LoaderExceptions 屬性。
在 System.Windows.Forms.Design.DocumentDesigner.AxToolboxItem.CreateComponentsCore(IDesignerHost host)
在 System.Drawing.Design.ToolboxItem.CreateComponentsCore(IDesignerHost host, IDictionary defaultValues)
在 System.Drawing.Design.ToolboxItem.CreateComponents(IDesignerHost host, IDictionary defaultValues)
在 System.Windows.Forms.Design.OleDragDropHandler.CreateTool(ToolboxItem tool, Control parent, Int32 x, Int32 y, Int32 width, Int32 height, Boolean hasLocation, Boolean hasSize, ToolboxSnapDragDropEventArgs e)”
確定
解決方法爲:打開解決方案的屬性需改紅色地方,不能爲Any Cpu,就解決了