Skip to content

Commit 9c7ce64

Browse files
committed
NH-3807 - Guard on use of DbProviderFactories for CoreClr.
1 parent 051f0ad commit 9c7ce64

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/NHibernate/Driver/ReflectionBasedDriver.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,16 @@ protected ReflectionBasedDriver(string providerInvariantName, string driverAssem
4242

4343
if (connectionType == null || commandType == null)
4444
{
45+
#if FEATURE_DBPROVIDERFACTORIES
4546
if (string.IsNullOrEmpty(providerInvariantName))
4647
{
4748
throw new HibernateException(string.Format(ReflectionTypedProviderExceptionMessageTemplate, driverAssemblyName));
4849
}
4950
var factory = DbProviderFactories.GetFactory(providerInvariantName);
5051
connectionCommandProvider = new DbProviderFactoryDriveConnectionCommandProvider(factory);
52+
#else
53+
throw new HibernateException(string.Format(ReflectionTypedProviderExceptionMessageTemplate, driverAssemblyName));
54+
#endif
5155
}
5256
else
5357
{
@@ -65,4 +69,4 @@ public override DbCommand CreateCommand()
6569
return connectionCommandProvider.CreateCommand();
6670
}
6771
}
68-
}
72+
}

0 commit comments

Comments
 (0)