0
我試圖使用app.config文件的連接字符串加載到類提供商,但我收到以下錯誤:Sql F#類型提供程序,App.Config和ConnectionStrings?
error FS3033: The type provider
'Microsoft.FSharp.Data.TypeProviders.DesignTime.DataProviders'
reported an error: Invalid provider''
in connection string entry'Server1'
in config file'...\app.config'
.SqlDataConnection
can only be used with provider'System.Data.SqlClient'
.
我把連接字符串中的app.config文件爲這樣:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="FSharp.Core" publicKeyToken="..." culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.3.1.0" newVersion="4.3.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<connectionStrings>
<add name="Server1" connectionString="Server=..."/>
<add name="Server2" connectionString="Server=..."/>
</connectionStrings>
</configuration>
,然後在F#中引用它們像這樣:
type dbSchema = SqlDataConnection<ConnectionStringName = "Server1", Views = false, Functions = false, StoredProcedures = false>
任何想法,其中的問題是什麼?
你可以從你的app.config發佈完整的連接字符串 - 你可以匿名的細節 - 我懷疑這可能不是有效的? – DaveShaw 2015-02-08 14:57:19