'SqlClientFactory' could not be found

Posts   
 
    
TBarn
User
Posts: 1
Joined: 21-Nov-2019
# Posted on: 21-Nov-2019 20:08:04   

I am trying to configure LLBL to work in a Blazor App (Net Core 3) using Self-Servicing. The LLBL project is generated to .Net Standard 2.1 and is referenced by the Blazor App. I have added these Nuget packages to the Blazor app:

SD.LLBLGen.Pro.DQE.SqlServer and SD.LLBLGen.Pro.ORMSupportClasses (both of them are version 5.6.1).

The LLBL project has the Nuget package SD.LLBLGen.Pro.DQE.SqlServer (5.6.1) installed. In the Startup.cs file of the Blazor app, I have included this line:

// Configure the DQE RuntimeConfiguration.ConfigureDQE<SQLServerDQEConfiguration>( c => c.SetTraceLevel(TraceLevel.Verbose) .AddDbProviderFactory(typeof(System.Data.SqlClient.SqlClientFactory)) .SetDefaultCompatibilityLevel(SqlServerCompatibilityLevel.SqlServer2012));

This is in the Configure method just after I set up the connection strings. The startup.cs file has these using statements: using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.HttpsPolicy; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using ChemicalInv.Data; using SD.LLBLGen.Pro.ORMSupportClasses; using SD.LLBLGen.Pro.DQE.SqlServer; using System.Diagnostics;

The problem is I get an error on the .AddDbProviderFactory(typeof(System.Data.SqlClient.SqlClientFactory)) statement.

Error:

The type name 'SqlClientFactory' could not be found in the namespace 'System.Data.SqlClient'. This type has been forwarded to assembly 'System.Data.SqlClient, Version=4.6.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' Consider adding a reference to that assembly.

What am I doing wrong?

Nevermind - I just needed to add the Nuget Package System.Data.SqlClient - duh!

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 22-Nov-2019 07:19:16   

Good you figured it out simple_smile

David Elizondo | LLBLGen Support Team