Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
"isRoot": true,
"tools": {
"paket": {
"version": "8.0.0",
"version": "9.0.2",
"commands": [
"paket"
]
],
"rollForward": false
}
}
}
1 change: 1 addition & 0 deletions build/build.fs
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@
try
DotNet.test (dnTestOptions "net462") testSlnPath
DotNet.test (dnTestOptions "netcoreapp3.1") testProjectPath
DotNet.test (dnTestOptions "net8.0") testProjectPath
with
| ex ->
Trace.log (sprintf "Test exception: %A" ex)
Expand Down Expand Up @@ -338,7 +339,7 @@

Target.create "ServeDocs" (fun _ ->
fakeiisexpress.HostStaticWebsite id (__SOURCE_DIRECTORY__ @@ @"docs\output\") |> ignore
fakeiisexpress.OpenUrlInBrowser "http://localhost:8080"

Check warning on line 342 in build/build.fs

View workflow job for this annotation

GitHub Actions / build

This construct is deprecated. This API is obsolete. There is no alternative in FAKE 5 yet. You can help by porting this module.
)

Target.create "ReleaseDocs" (fun _ ->
Expand Down
15 changes: 8 additions & 7 deletions paket.dependencies
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
source https://www.nuget.org/api/v2/
generate_load_scripts: on
storage: none
github fsprojects/FSharp.TypeProviders.SDK:28a24a69ada68ebd1ad25226634f4608e4875493 src/ProvidedTypes.fs
github fsprojects/FSharp.TypeProviders.SDK:28a24a69ada68ebd1ad25226634f4608e4875493 src/ProvidedTypes.fsi
github fsprojects/FSharp.TypeProviders.SDK:28a24a69ada68ebd1ad25226634f4608e4875493 src/ProvidedTypesTesting.fs
github fsprojects/FSharp.TypeProviders.SDK src/ProvidedTypes.fsi
github fsprojects/FSharp.TypeProviders.SDK src/ProvidedTypes.fs

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

nuget Fun.Build
nuget FSharp.Core
nuget FSharp.Core 8.0.301

nuget Fake.Core.Process
nuget Fake.Core.ReleaseNotes
Expand All @@ -21,6 +20,8 @@ group Build
nuget Fake.DotNet.NuGet
nuget Fake.DotNet.Testing.XUnit2
nuget Fake.Tools.Git
nuget FSharp.Formatting
nuget FSharp.Compiler.Service 43.8.301

nuget NuGet.CommandLine
nuget System.Data.SqlClient
Expand All @@ -38,7 +39,7 @@ group Docs

group DesignTime
source https://www.nuget.org/api/v2/
framework: >= net461, >= netstandard20
framework: >= net461, >= netstandard20, net8.0
storage: none

nuget System.Configuration.ConfigurationManager
Expand Down Expand Up @@ -70,7 +71,7 @@ group Net40

group TestProjects
source https://www.nuget.org/api/v2/
framework: >= net40, >= netcoreapp2.0, >= netstandard2.0
framework: >= net40, >= netcoreapp2.0, >= netstandard2.0, net8.0
storage: none

nuget FSharp.Core = 4.3.4
Expand All @@ -80,7 +81,7 @@ group TestProjects

group Samples
source https://www.nuget.org/api/v2/
framework: >= net40, >= netcoreapp2.0, >= netstandard2.0
framework: >= net40, >= netcoreapp2.0, >= netstandard2.0, net8.0
redirects: on

nuget FSharp.Core = 4.5.2 redirects: force
Expand Down
1,063 changes: 237 additions & 826 deletions paket.lock

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/SqlClient.DesignTime/SqlClient.DesignTime.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\netfx.props" />
<PropertyGroup>
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net461;netstandard2.0;net8.0</TargetFrameworks>
<AssemblyName>FSharp.Data.SqlClient.DesignTime</AssemblyName>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<NoWarn>$(NoWarn);101</NoWarn>

<!--
Expand Down
13 changes: 12 additions & 1 deletion src/SqlClient.Samples/WebApi.Controllers/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,15 @@
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
<runtime><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<Paket>True</Paket>
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.5.0.0" />
</dependentAssembly>
<dependentAssembly>
<Paket>True</Paket>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="12.0.0.0" />
</dependentAssembly>
</assemblyBinding></runtime></configuration>
449 changes: 444 additions & 5 deletions src/SqlClient.Samples/WebApi.Controllers/WebApi.Controllers.fsproj

Large diffs are not rendered by default.

454 changes: 447 additions & 7 deletions src/SqlClient.Samples/WebApi/WebApi.csproj

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/SqlClient.Samples/WebApi/web.config
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@
</system.Web>
-->
<system.web>
<compilation debug="true" targetFramework="4.5.2" />
<compilation debug="true" targetFramework="4.8" />
<httpRuntime targetFramework="4.5" />
</system.web>

<system.webServer>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
Expand All @@ -24,6 +23,7 @@
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
</system.webServer>

<runtime><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<Paket>True</Paket>
Expand Down
45 changes: 45 additions & 0 deletions src/SqlClient.Samples/WpfDataBinding/SqlServerTypes/Loader.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using System;
using System.IO;
using System.Runtime.InteropServices;

namespace SqlServerTypes
{
/// <summary>
/// Utility methods related to CLR Types for SQL Server
/// </summary>
public class Utilities
{
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern IntPtr LoadLibrary(string libname);

/// <summary>
/// Loads the required native assemblies for the current architecture (x86 or x64)
/// </summary>
/// <param name="rootApplicationPath">
/// Root path of the current application. Use Server.MapPath(".") for ASP.NET applications
/// and AppDomain.CurrentDomain.BaseDirectory for desktop applications.
/// </param>
public static void LoadNativeAssemblies(string rootApplicationPath)
{
var nativeBinaryPath = IntPtr.Size > 4
? Path.Combine(rootApplicationPath, @"SqlServerTypes\x64\")
: Path.Combine(rootApplicationPath, @"SqlServerTypes\x86\");

LoadNativeAssembly(nativeBinaryPath, "msvcr120.dll");
LoadNativeAssembly(nativeBinaryPath, "SqlServerSpatial140.dll");
}

private static void LoadNativeAssembly(string nativeBinaryPath, string assemblyName)
{
var path = Path.Combine(nativeBinaryPath, assemblyName);
var ptr = LoadLibrary(path);
if (ptr == IntPtr.Zero)
{
throw new Exception(string.Format(
"Error loading {0} (ErrorCode: {1})",
assemblyName,
Marshal.GetLastWin32Error()));
}
}
}
}
61 changes: 61 additions & 0 deletions src/SqlClient.Samples/WpfDataBinding/SqlServerTypes/readme.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<html lang="en-US">
<head>
<meta charset="utf-8" />
<title>Microsoft.SqlServer.Types</title>
<style>
body {
background: #fff;
color: #505050;
margin: 20px;
}

#main {
background: #efefef;
padding: 5px 30px;
}
</style>
</head>
<body>
<div id="main">
<h1>Action required to load native assemblies</h1>
<p>
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.
</p>
<p>
You need to add code to load the correct one of these assemblies at runtime (depending on the current architecture).
</p>
<h2>ASP.NET Web Sites</h2>
<p>
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:
<pre>
Default.aspx.cs:

public partial class _Default : System.Web.UI.Page
{
static bool _isSqlTypesLoaded = false;

public _Default()
{
if (!_isSqlTypesLoaded)
{
SqlServerTypes.Utilities.LoadNativeAssemblies(Server.MapPath("~"));
_isSqlTypesLoaded = true;
}

}
}
</pre>
</p>
<h2>ASP.NET Web Applications</h2>
<p>
For ASP.NET Web Applications, add the following line of code to the Application_Start method in Global.asax.cs:
<pre> SqlServerTypes.Utilities.LoadNativeAssemblies(Server.MapPath("~/bin"));</pre>
</p>
<h2>Desktop Applications</h2>
<p>
For desktop applications, add the following line of code to run before any spatial operations are performed:
<pre> SqlServerTypes.Utilities.LoadNativeAssemblies(AppDomain.CurrentDomain.BaseDirectory);</pre>
</p>
</div>
</body>
</html>
Loading
Loading