Skip to content

Commit 08029f9

Browse files
ngbrownhazzik
authored andcommitted
NH-3807 - Guard on use of DbProviderFactories for CoreClr.
1 parent 77a6c94 commit 08029f9

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
@@ -41,12 +41,16 @@ protected ReflectionBasedDriver(string providerInvariantName, string driverAssem
4141

4242
if (connectionType == null || commandType == null)
4343
{
44+
#if FEATURE_DBPROVIDERFACTORIES
4445
if (string.IsNullOrEmpty(providerInvariantName))
4546
{
4647
throw new HibernateException(string.Format(ReflectionTypedProviderExceptionMessageTemplate, driverAssemblyName));
4748
}
4849
var factory = DbProviderFactories.GetFactory(providerInvariantName);
4950
connectionCommandProvider = new DbProviderFactoryDriveConnectionCommandProvider(factory);
51+
#else
52+
throw new HibernateException(string.Format(ReflectionTypedProviderExceptionMessageTemplate, driverAssemblyName));
53+
#endif
5054
}
5155
else
5256
{
@@ -64,4 +68,4 @@ public override DbCommand CreateCommand()
6468
return connectionCommandProvider.CreateCommand();
6569
}
6670
}
67-
}
71+
}

0 commit comments

Comments
 (0)