Skip to content

Issue when registering into SQL server a SQL CLR assembly referencing SQLProvider #541

@francotiveron

Description

@francotiveron

Description

I have a F# DLL (.NET Framework 4.5.1, F# 4.1, FSharp.Core 4.4.3.0). The only added reference is to FSharp.Data.SqlProvider 1.1.41.

The code is in on file only

module DB

open FSharp.Data.Sql

[<Literal>]
let private dbVendor = Common.DatabaseProviderTypes.MSSQLSERVER

Build goes without errors

Repro steps

  1. Step A

Import the built dll in SQL server as assembly
CREATE ASSEMBLY [Library2] FROM 'path\Library2.dll' WITH PERMISSION_SET = UNSAFE

Expected behavior

Assembly correctly imported

Actual behavior

Operation fails with error
Assembly 'Library2' references assembly 'fsharp.core, version=4.3.1.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a.', which is not present in the current database. SQL Server attempted to locate and automatically load the referenced assembly from the same location where referring assembly came from, but that operation has failed (reason: version, culture or public key mismatch). Please load the referenced assembly into the current database and retry your request

  1. Step A

comment the last two rows in the code

//[<Literal>]
//let private dbVendor = Common.DatabaseProviderTypes.MSSQLSERVER

Expected behavior

No difference from 1.

Actual behavior

Operation succeeds, the assembly is correctly created in SQL server

Known workarounds

If I downgrade the project to F# 3.1 (FSharp.Core 4.3.1.0), then no error in both cases

Related information

  • Used database
    SQL Server 14.0.1000
  • Operating system
    Windows 10 Pro
  • .NET Runtime, CoreCLR or Mono Version
    4.5.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions