MySql issues when using .NET CORE 2

Posts   
 
    
hplloyd
User
Posts: 191
Joined: 29-Oct-2004
# Posted on: 31-May-2018 02:47:28   

Hi,

I am trying to run a small unit test to add a record to a MySql table using .Net Core 2 - I am using the latest version of LLBL

As per your guide I have purchased a copy of the Devart Standard and have received my activation code etc

I have included the Devart.Data.MySql nuget package in my test project and have made sure I have included the license key in the connection string like this

Server=localhost;Database=kz_unittest_001;User ID=root;Password=blahblahblah;License Key=gbk0KLenlFJ3c8ll1WYRd4n8ga.............etc;

However when I try to commit my entity to the database I get the following error thrown by LLBLGen

SD.LLBLGen.Pro.ORMSupportClasses.ORMConfigurationException: 'No DbProviderFactory has been configured for this DQE. You have to use the DQE configuration system to register at least one DbProviderFactory.'

I have a repository project that I have included as a dependency to the unit test project and the repository project itself references the 2 projects (Generic and Specific) that are generated by LLBLGen and both target the .Net Standard 2.0 framework

Obviously .NET Core does not use DBProviderFactory so I assume somehow I have not configured something correctly

Can you help?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39760
Joined: 17-Aug-2003
# Posted on: 31-May-2018 09:11:25   

You have to specify the DbProviderFactory of the mysql ado.net provider with the runtime, see: https://www.llblgen.com/Documentation/5.4/LLBLGen%20Pro%20RTF/Using%20the%20generated%20code/gencode_runtimeconfiguration.htm#dbproviderfactory

This is required as .NET Core 2.0 doesn't have a DbProviderFactories storage (I implemented it for .NET core 2.1, but it's not in .net core 2.0 / .net standard2.0, and even then you have to register the factory manually, as .NET core doesn't have a machine.config file where factories are registered on .net full)

Frans Bouma | Lead developer LLBLGen Pro
hplloyd
User
Posts: 191
Joined: 29-Oct-2004
# Posted on: 31-May-2018 09:37:37   

Oh my goodness - Amazing and it works straight away

I have been using LLBLGen for over 10 years (No more like 15 years) on EVERY project I have ever done and now that I am embarking on my biggest and most ambitious project ever, LLBLGen is right there are the core !!

Many thanks for making my life SOOOOO much easier !!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39760
Joined: 17-Aug-2003
# Posted on: 31-May-2018 11:00:45   

hplloyd wrote:

Oh my goodness - Amazing and it works straight away

Cool! simple_smile

I have been using LLBLGen for over 10 years (No more like 15 years) on EVERY project I have ever done and now that I am embarking on my biggest and most ambitious project ever, LLBLGen is right there are the core !!

Many thanks for making my life SOOOOO much easier !!

You're welcome simple_smile Glad we can be of help smile

Frans Bouma | Lead developer LLBLGen Pro