File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" utf-8" ?>
22<Project Sdk =" Microsoft.NET.Sdk" >
33 <PropertyGroup >
4- <TargetFrameworks >net9.0</TargetFrameworks >
4+ <TargetFrameworks >net9.0;netstandard2.0 </TargetFrameworks >
55 <AssemblyName >FSharp.Data.SqlClient.DesignTime</AssemblyName >
66 <EnableDefaultCompileItems >false</EnableDefaultCompileItems >
77 <AutoGenerateBindingRedirects >true</AutoGenerateBindingRedirects >
1919 <WarningsNotAsErrors >$(WarningsNotAsErrors);FS0026;FS3218;FS3548</WarningsNotAsErrors >
2020 <DisableImplicitFSharpCoreReference >true</DisableImplicitFSharpCoreReference >
2121 <DisableImplicitSystemValueTupleReference >true</DisableImplicitSystemValueTupleReference >
22- <DefineConstants >$(DefineConstants);DESIGNTIME_CODE_ONLY;IS_DESIGNTIME;WITH_LEGACY_NAMESPACE;USE_SYSTEM_DATA_COMMON_DBPROVIDERFACTORIES</DefineConstants >
22+ <DefineConstants >$(DefineConstants);DESIGNTIME_CODE_ONLY;IS_DESIGNTIME;WITH_LEGACY_NAMESPACE</DefineConstants >
23+ <DefineConstants Condition =" '$(TargetFramework)' == 'net9.0'" >$(DefineConstants);USE_SYSTEM_DATA_COMMON_DBPROVIDERFACTORIES</DefineConstants >
2324 </PropertyGroup >
2425 <ItemGroup >
2526 <!--
8990 <_TPRid Condition =" $([MSBuild]::IsOSPlatform('Windows'))" >win</_TPRid >
9091 <_TPOutputDir >$(TargetDir)</_TPOutputDir >
9192 <_TPRuntimeDir >$(_TPOutputDir)runtimes/$(_TPRid)/lib/$(TargetFramework)</_TPRuntimeDir >
93+ <!-- For netstandard2.0, NuGet does not copy RID-specific assemblies.
94+ Fall back to the net9.0 sibling output (built first). -->
95+ <_TPRuntimeDir Condition =" !Exists('$(_TPRuntimeDir)')" >$(_TPOutputDir)../net9.0/runtimes/$(_TPRid)/lib/net9.0</_TPRuntimeDir >
9296 </PropertyGroup >
9397 <ItemGroup >
9498 <_RidSpecificAssemblies Include =" $(_TPRuntimeDir)/*.dll" />
Original file line number Diff line number Diff line change @@ -127,15 +127,17 @@ type SqlEnumProvider(config: TypeProviderConfig) as this =
127127 if not ( DbProviderFactories.GetProviderInvariantNames() |> Seq.contains providerName) then
128128 DbProviderFactories.RegisterFactory( providerName, Microsoft.Data.SqlClient.SqlClientFactory.Instance)
129129
130- #endif
131130 let adoObjectsFactory = DbProviderFactories.GetFactory( providerName: string)
132131 use conn = adoObjectsFactory.CreateConnection()
133132 conn.ConnectionString <- connStr
133+ #else
134+ use conn =
135+ new Microsoft.Data.SqlClient.SqlConnection( connStr) :> System.Data.Common.DbConnection
136+ #endif
134137 conn.Open()
135138
136- use cmd = adoObjectsFactory .CreateCommand()
139+ use cmd = conn .CreateCommand()
137140 cmd.CommandText <- query
138- cmd.Connection <- conn
139141 cmd.CommandType <- CommandType.Text
140142
141143 use reader = cmd.ExecuteReader()
You can’t perform that action at this time.
0 commit comments