CapableObjects › Forums › SupportForum › MySQL connection
This topic contains 4 replies, has 2 voices, and was last updated by william 5 years, 10 months ago.
Hi, I would like to reverse engineer a MySQL DB and failed in putting a PersistenceMapperMySQL to the form designer. I am using VS 2017 with MDriven 188.8.131.5202.
--------------------------- Microsoft Visual Studio --------------------------- Failed to create component 'PersistenceMapperMySql'. The error message follows: 'System.InvalidCastException: Unable to cast object of type 'Eco.Persistence.PersistenceMapperMySql' to type 'Eco.Persistence.PersistenceMapperDb'. at Eco.Persistence.Design.PersistenceHandleDesigner.InitializeComponent(IMapperVerbConfigurator configurator) at Eco.Persistence.Design.MySqlPersistenceHandleDesigner.InitializeNewComponent(IDictionary defaultValues) at System.Drawing.Design.ToolboxItem.CreateComponentsCore(IDesignerHost host, IDictionary defaultValues) at System.Drawing.Design.ToolboxItem.CreateComponents(IDesignerHost host, IDictionary defaultValues) at System.Windows.Forms.Design.OleDragDropHandler.CreateTool(ToolboxItem tool, Control parent, Int32 x, Int32 y, Int32 width, Int32 height, Boolean hasLocation, Boolean hasSize, ToolboxSnapDragDropEventArgs e)' --------------------------- OK ---------------------------
Most likely is it that the one you find in the toolbox is not pointing to correct version. Try adding C:\Program Files (x86)\CapableObjects\MDriven\7.0\bin\Eco.Persistence.MySql.dll to the toolbox manually
Also search for different old versions on this and remove
Hi, I have checked the component should be of the same version as the framework…. see the attached screenshot.
Attachments:You must be logged in to view attached files.
Go to the GAC and see:
Remove all Eco.Persistence.MySql versions but the one you want.
(you may need to close VS to remove file lock)
After this there is only 1 Eco.Persistence.MySql for VS to find.
(at this point I am not able to answer why Eco.Persistence.MySql behaves this way – I suspect it is that we upgraded the MySql.Data.dll – and that Eco.Persistence.MySql.Design uses the new one – VS finds an old Eco.Persistence.MySql i the GAC and thinks its fine – but Eco.Persistence.MySql.Design cannot talk to it)
Thank you very much for the tips! After removing all obsolete versions and set “Specific Version” to false in the IDE, it is working now. BTW, I need to use connection string instead of a MySQLConnection component perhaps due to version mismatch? The one I use is 6.9.9 instead of 6.9.8 since I can no longer find 6.9.8 on the official Oracle site. Here is the list of MDriven related assemblies with obsolete versions on my machine (all files are removed by now):
Eco.Handles Eco.Ide Eco.Ide.VS Eco.Interfaces Eco.LinqExtender Eco.ModelLayer Eco.Modlr.CodeGen Eco.Modlr.DbReverse Eco.Modlr.ExtendedModelLayer Eco.Modlr.IdeIntegration Eco.Modlr.Layout Eco.Modlr.ModelEditor Eco.Modlr.ModelEditor.NoUI Eco.Persistence Eco.Persistence.Oracle Eco.Persistence.SQLite Eco.Persistence.SqlServer Eco.Web Eco.Web.Providers Eco.Web.Providers.Model Eco.Windows.Forms Eco.WPF DroopyEyes.Eco.AutoContainers DroopyEyes.Eco.CacheFiltering DroopyEyes.Eco.Core DroopyEyes.Eco.Validation DroopyEyes.Eco.WinForm DroopyEyes.Eco.XmlQueryService
You must be logged in to reply to this topic.