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