[<Literal>]
let dbVendor = Common.DatabaseProviderTypes.MSSQLSERVER_SSDT
[<Literal>]
let SsdtPath = __SOURCE_DIRECTORY__ + @"/../Database/bin/Debug/Database.dacpac"
type DB = SqlDataProvider<Common.DatabaseProviderTypes.MSSQLSERVER_SSDT, SsdtPath = SsdtPath>
let ctx = DB.GetDataContext(@"<connection_string_goes_here>")
We tried to add a row to a table and got the following error:
Unhandled exception. System.TypeInitializationException: The type initializer for 'SqlProvider' threw an exception.
---> System.TypeInitializationException: The type initializer for '<StartupCode$TestProject>.$SqlProvider' threw an exception.
---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.SqlClient, Version=4.6.1.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'System.Data.SqlClient, Version=4.6.1.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at FSharp.Data.Sql.Providers.MSSqlServerProviderSsdt..ctor(String tableNames, String ssdtPath)
at FSharp.Data.Sql.Runtime.ProviderBuilder.createProvider(DatabaseProviderTypes vendor, String resolutionPath, String[] referencedAssemblies, String runtimeAssembly, String owner, String tableNames, String contextSchemaPath, OdbcQuoteCharacter odbcquote, SQLiteLibrary sqliteLibrary, String ssdtPath)
at <StartupCode$FSharp-Data-SqlProvider>.$SqlRuntime.DataContext.addCache@38-1.Invoke(Unit unitVar)
at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy`1.CreateValue()
at System.Lazy`1.get_Value()
at FSharp.Data.Sql.Runtime.SqlDataContext..ctor(String typeName, String connectionString, DatabaseProviderTypes providerType, String resolutionPath, String[] referencedAssemblies, String runtimeAssembly, String owner, CaseSensitivityChange caseSensitivity, String tableNames, String contextSchemaPath, OdbcQuoteCharacter odbcquote, SQLiteLibrary sqliteLibrary, TransactionOptions transactionOptions, FSharpOption`1 commandTimeout, SelectOperations sqlOperationsInSelect, String ssdtPath)
at <StartupCode$TestProject>.$SqlProvider..cctor() in C:\Users\isaac\code\TestProject\Test\SqlProvider.fs:line 13
--- End of inner exception stack trace ---
at SqlProvider..cctor()
--- End of inner exception stack trace ---
We tried to add a row to a table and got the following error:
Not sure how to fix this.