Skip to content

Commit 0eec9f1

Browse files
author
Sam Hanes
committed
Include reference to Microsoft.SqlServer.Types in TP assembly
1 parent f1249b2 commit 0eec9f1

5 files changed

Lines changed: 18 additions & 1 deletion

File tree

paket.dependencies

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ generate_load_scripts: on
55

66
nuget FSharp.Core = 4.1.2
77
nuget Microsoft.SqlServer.TransactSql.ScriptDom
8+
nuget Microsoft.SqlServer.Types ~> 12
89

910
github fsprojects/FSharp.TypeProviders.SDK:7d57cd409d7299592822713195924e42b2b7acde src/ProvidedTypes.fs
1011
github fsprojects/FSharp.TypeProviders.SDK:7d57cd409d7299592822713195924e42b2b7acde src/ProvidedTypes.fsi

paket.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ NUGET
3030
System.ValueTuple (>= 4.3) - restriction: && (>= net40) (< netstandard1.6)
3131
Microsoft.NETCore.Platforms (2.0.2) - restriction: || (&& (>= net40) (< net45) (>= netstandard1.1) (< netstandard1.2)) (&& (>= net40) (< net45) (>= netstandard1.2) (< netstandard1.3)) (&& (>= net40) (< net45) (>= netstandard1.3) (< netstandard1.4)) (&& (>= net40) (< net45) (>= netstandard1.4) (< netstandard1.5)) (&& (>= net40) (< net45) (>= netstandard1.5) (< netstandard1.6)) (&& (>= net40) (< net45) (< netstandard1.6) (>= netstandard2.0)) (&& (>= net40) (>= netcoreapp2.0) (< netstandard1.6)) (&& (>= net40) (>= netstandard1.0) (< portable-net45+win8+wpa81)) (&& (>= net40) (< netstandard1.3) (>= wpa81)) (&& (>= net40) (< netstandard1.5) (>= uap10.0)) (&& (>= net40) (>= uap10.1)) (&& (>= net40) (>= wp8)) (&& (>= net45) (< netstandard1.3)) (&& (>= net46) (< netstandard1.4))
3232
Microsoft.SqlServer.TransactSql.ScriptDom (14.0.3811.1)
33+
Microsoft.SqlServer.Types (12.0.5000)
3334
Microsoft.Win32.Primitives (4.3) - restriction: || (&& (>= net40) (< net45) (>= netstandard1.3) (< netstandard1.4)) (&& (>= net40) (< net45) (>= netstandard1.4) (< netstandard1.5)) (&& (>= net40) (< net45) (>= netstandard1.5) (< netstandard1.6)) (&& (>= net40) (< netstandard1.5) (>= uap10.0)) (&& (>= net46) (< netstandard1.4))
3435
NETStandard.Library (2.0.3) - restriction: && (>= net40) (< net461) (>= netstandard1.0) (< netstandard1.6)
3536
Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (>= net40) (< net45) (>= netstandard1.1) (< netstandard1.2)) (&& (>= net40) (< net45) (>= netstandard1.2) (< netstandard1.3)) (&& (>= net40) (< net45) (>= netstandard1.3) (< netstandard1.4)) (&& (>= net40) (< net45) (>= netstandard1.4) (< netstandard1.5)) (&& (>= net40) (< net45) (>= netstandard1.5) (< netstandard1.6)) (&& (>= net40) (< net45) (>= netstandard1.6) (< netstandard2.0)) (&& (>= net40) (< net45) (>= netstandard2.0)) (&& (>= net40) (>= netcoreapp2.0)) (&& (>= net40) (>= netstandard1.0) (< portable-net45+win8+wpa81)) (&& (>= net40) (< netstandard1.0) (>= portable-net45+win8)) (&& (>= net40) (< netstandard1.0) (< portable-net45+win8) (>= portable-net45+win8+wpa81)) (&& (>= net40) (< netstandard1.0) (>= portable-net45+win8+wp8+wpa81) (< portable-net45+win8+wpa81)) (&& (>= net40) (< netstandard1.0) (>= win8)) (&& (>= net40) (< netstandard1.3) (>= wpa81)) (&& (>= net40) (< netstandard1.5) (>= uap10.0)) (&& (>= net40) (>= uap10.1)) (&& (>= net40) (>= wp8)) (&& (>= net45) (< netstandard1.3)) (&& (>= net46) (< netstandard1.4)) (>= net461)

src/SqlClient/SqlClient.fsproj

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,17 @@
149149
</ItemGroup>
150150
</When>
151151
</Choose>
152+
<Choose>
153+
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.0' Or $(TargetFrameworkVersion) == 'v4.0.3' Or $(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7' Or $(TargetFrameworkVersion) == 'v4.7.1' Or $(TargetFrameworkVersion) == 'v4.7.2')">
154+
<ItemGroup>
155+
<Reference Include="Microsoft.SqlServer.Types">
156+
<HintPath>..\..\packages\Microsoft.SqlServer.Types\lib\net40\Microsoft.SqlServer.Types.dll</HintPath>
157+
<Private>True</Private>
158+
<Paket>True</Paket>
159+
</Reference>
160+
</ItemGroup>
161+
</When>
162+
</Choose>
152163
<Choose>
153164
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6'">
154165
<ItemGroup>

src/SqlClient/SqlCommandProvider.fs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ do()
2929
[<CompilerMessageAttribute("This API supports the FSharp.Data.SqlClient infrastructure and is not intended to be used directly from your code.", 101, IsHidden = true)>]
3030
type SqlCommandProvider(config : TypeProviderConfig) as this =
3131
inherit TypeProviderForNamespaces(config, addDefaultProbingLocation = true)
32-
32+
33+
// need to make sure microsoft.sqlserver.types is included as a referenced assembly
34+
let _ = Microsoft.SqlServer.Types.SqlGeography.Null
35+
3336
let nameSpace = this.GetType().Namespace
3437
let assembly = Assembly.LoadFrom( config.RuntimeAssembly)
3538
let providerType = ProvidedTypeDefinition(assembly, nameSpace, "SqlCommandProvider", Some typeof<obj>, hideObjectMethods = true)

src/SqlClient/paket.references

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
FSharp.Core
22
Microsoft.SqlServer.TransactSql.ScriptDom
3+
Microsoft.SqlServer.Types
34

45
File: ProvidedTypes.fsi .
56
File: ProvidedTypes.fs .

0 commit comments

Comments
 (0)