Skip to content

Commit 92b65a9

Browse files
Thoriumsmoothdeveloper
authored andcommitted
Package updates, to get this project to compile
1 parent c6e48a4 commit 92b65a9

File tree

12 files changed

+1658
-852
lines changed

12 files changed

+1658
-852
lines changed

.config/dotnet-tools.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
"isRoot": true,
44
"tools": {
55
"paket": {
6-
"version": "8.0.0",
6+
"version": "9.0.2",
77
"commands": [
88
"paket"
9-
]
9+
],
10+
"rollForward": false
1011
}
1112
}
1213
}

paket.dependencies

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
source https://www.nuget.org/api/v2/
22
generate_load_scripts: on
33
storage: none
4-
github fsprojects/FSharp.TypeProviders.SDK:28a24a69ada68ebd1ad25226634f4608e4875493 src/ProvidedTypes.fs
5-
github fsprojects/FSharp.TypeProviders.SDK:28a24a69ada68ebd1ad25226634f4608e4875493 src/ProvidedTypes.fsi
6-
github fsprojects/FSharp.TypeProviders.SDK:28a24a69ada68ebd1ad25226634f4608e4875493 src/ProvidedTypesTesting.fs
4+
github fsprojects/FSharp.TypeProviders.SDK:23b588d06acb8e100402523abc1d4f3f06325b8a src/ProvidedTypes.fs
5+
github fsprojects/FSharp.TypeProviders.SDK:23b588d06acb8e100402523abc1d4f3f06325b8a src/ProvidedTypes.fsi
6+
github fsprojects/FSharp.TypeProviders.SDK:23b588d06acb8e100402523abc1d4f3f06325b8a src/ProvidedTypesTesting.fs
77

88
group Build
99
source https://www.nuget.org/api/v2/
1010

1111
nuget Fun.Build
12-
nuget FSharp.Core
12+
nuget FSharp.Core 8.0.301
1313

1414
nuget Fake.Core.Process
1515
nuget Fake.Core.ReleaseNotes
@@ -21,6 +21,8 @@ group Build
2121
nuget Fake.DotNet.NuGet
2222
nuget Fake.DotNet.Testing.XUnit2
2323
nuget Fake.Tools.Git
24+
nuget FSharp.Formatting
25+
nuget FSharp.Compiler.Service 43.8.301
2426

2527
nuget NuGet.CommandLine
2628
nuget System.Data.SqlClient

paket.lock

Lines changed: 235 additions & 823 deletions
Large diffs are not rendered by default.

src/SqlClient.Samples/WebApi.Controllers/App.config

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,15 @@
88
<startup>
99
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
1010
</startup>
11-
</configuration>
11+
<runtime><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
12+
<dependentAssembly>
13+
<Paket>True</Paket>
14+
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
15+
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.5.0.0" />
16+
</dependentAssembly>
17+
<dependentAssembly>
18+
<Paket>True</Paket>
19+
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
20+
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="12.0.0.0" />
21+
</dependentAssembly>
22+
</assemblyBinding></runtime></configuration>

src/SqlClient.Samples/WebApi.Controllers/WebApi.Controllers.fsproj

Lines changed: 444 additions & 5 deletions
Large diffs are not rendered by default.

src/SqlClient.Samples/WebApi/WebApi.csproj

Lines changed: 447 additions & 7 deletions
Large diffs are not rendered by default.

src/SqlClient.Samples/WebApi/web.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@
1212
</system.Web>
1313
-->
1414
<system.web>
15-
<compilation debug="true" targetFramework="4.5.2" />
15+
<compilation debug="true" targetFramework="4.8" />
1616
<httpRuntime targetFramework="4.5" />
1717
</system.web>
18-
1918
<system.webServer>
2019
<handlers>
2120
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
@@ -24,6 +23,7 @@
2423
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
2524
</handlers>
2625
</system.webServer>
26+
2727
<runtime><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
2828
<dependentAssembly>
2929
<Paket>True</Paket>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
using System;
2+
using System.IO;
3+
using System.Runtime.InteropServices;
4+
5+
namespace SqlServerTypes
6+
{
7+
/// <summary>
8+
/// Utility methods related to CLR Types for SQL Server
9+
/// </summary>
10+
public class Utilities
11+
{
12+
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
13+
private static extern IntPtr LoadLibrary(string libname);
14+
15+
/// <summary>
16+
/// Loads the required native assemblies for the current architecture (x86 or x64)
17+
/// </summary>
18+
/// <param name="rootApplicationPath">
19+
/// Root path of the current application. Use Server.MapPath(".") for ASP.NET applications
20+
/// and AppDomain.CurrentDomain.BaseDirectory for desktop applications.
21+
/// </param>
22+
public static void LoadNativeAssemblies(string rootApplicationPath)
23+
{
24+
var nativeBinaryPath = IntPtr.Size > 4
25+
? Path.Combine(rootApplicationPath, @"SqlServerTypes\x64\")
26+
: Path.Combine(rootApplicationPath, @"SqlServerTypes\x86\");
27+
28+
LoadNativeAssembly(nativeBinaryPath, "msvcr120.dll");
29+
LoadNativeAssembly(nativeBinaryPath, "SqlServerSpatial140.dll");
30+
}
31+
32+
private static void LoadNativeAssembly(string nativeBinaryPath, string assemblyName)
33+
{
34+
var path = Path.Combine(nativeBinaryPath, assemblyName);
35+
var ptr = LoadLibrary(path);
36+
if (ptr == IntPtr.Zero)
37+
{
38+
throw new Exception(string.Format(
39+
"Error loading {0} (ErrorCode: {1})",
40+
assemblyName,
41+
Marshal.GetLastWin32Error()));
42+
}
43+
}
44+
}
45+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<html lang="en-US">
2+
<head>
3+
<meta charset="utf-8" />
4+
<title>Microsoft.SqlServer.Types</title>
5+
<style>
6+
body {
7+
background: #fff;
8+
color: #505050;
9+
margin: 20px;
10+
}
11+
12+
#main {
13+
background: #efefef;
14+
padding: 5px 30px;
15+
}
16+
</style>
17+
</head>
18+
<body>
19+
<div id="main">
20+
<h1>Action required to load native assemblies</h1>
21+
<p>
22+
To deploy an application that uses spatial data types to a machine that does not have 'System CLR Types for SQL Server' installed you also need to deploy the native assembly SqlServerSpatial140.dll. Both x86 (32 bit) and x64 (64 bit) versions of this assembly have been added to your project under the SqlServerTypes\x86 and SqlServerTypes\x64 subdirectories. The native assembly msvcr120.dll is also included in case the C++ runtime is not installed.
23+
</p>
24+
<p>
25+
You need to add code to load the correct one of these assemblies at runtime (depending on the current architecture).
26+
</p>
27+
<h2>ASP.NET Web Sites</h2>
28+
<p>
29+
For ASP.NET Web Sites, add the following block of code to the code behind file of the Web Form where you have added Report Viewer Control:
30+
<pre>
31+
Default.aspx.cs:
32+
33+
public partial class _Default : System.Web.UI.Page
34+
{
35+
static bool _isSqlTypesLoaded = false;
36+
37+
public _Default()
38+
{
39+
if (!_isSqlTypesLoaded)
40+
{
41+
SqlServerTypes.Utilities.LoadNativeAssemblies(Server.MapPath("~"));
42+
_isSqlTypesLoaded = true;
43+
}
44+
45+
}
46+
}
47+
</pre>
48+
</p>
49+
<h2>ASP.NET Web Applications</h2>
50+
<p>
51+
For ASP.NET Web Applications, add the following line of code to the Application_Start method in Global.asax.cs:
52+
<pre> SqlServerTypes.Utilities.LoadNativeAssemblies(Server.MapPath("~/bin"));</pre>
53+
</p>
54+
<h2>Desktop Applications</h2>
55+
<p>
56+
For desktop applications, add the following line of code to run before any spatial operations are performed:
57+
<pre> SqlServerTypes.Utilities.LoadNativeAssemblies(AppDomain.CurrentDomain.BaseDirectory);</pre>
58+
</p>
59+
</div>
60+
</body>
61+
</html>

0 commit comments

Comments
 (0)