由于某种原因,我无法为特定数据库创建类型提供程序。我的代码看起来有点像这样(显然不是实际的数据库名称):
type db1 = SqlDataConnection<"Data Source=SQL_05;Initial Catalog=**DATABASE1**;Integrated Security=true;MultipleActiveResultSets=True">
type db2 = SqlDataConnection<"Data Source=SQL_08;Initial Catalog=**DATABASE2**;Integrated Security=true;MultipleActiveResultSets=True">
type db3 = SqlDataConnection<"Data Source=SQL_10;Initial Catalog=**DATABASE3**;Integrated Security=true;MultipleActiveResultSets=True">
前两行完全没问题,我的程序工作正常,只要这些是我需要的唯一数据库。但是,一旦我添加了第三行,我就会遇到一个巨大的错误:
The type provider 'Microsoft.FSharp.Data.TypeProviders.DesignTime.DataProviders' reported an error:
tmp7AA1.cs(12,7): warning CS0437: The type 'System' in '...\AppData\Local\Temp\tmp7AA1.cs' conflicts with the imported namespace 'System' in 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Configuration.dll'. Using the type defined in '...\AppData\Local\Temp\tmp7AA1.cs'.
tmp7AA1.cs(88967,22): (Location of symbol related to previous warning)
c:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Configuration.dll: (Location of symbol related to previous warning)
tmp7AA1.cs(12,7): error CS0138: A using namespace directive can only be applied to namespaces; 'System' is a type not a namespace
tmp7AA1.cs(88967,22): (Location of symbol related to previous error)tmp7AA1.cs(13,7):
warning CS0437: The type 'System' in '...\AppData\Local\Temp\tmp7AA1.cs' conflicts with the imported namespace 'System' in 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Configuration.dll'. Using the type defined in '...\AppData\Local\Temp\tmp7AA1.cs'.
tmp7AA1.cs(88967,22): (Location of symbol related to previous warning)
c:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Configuration.dll: (Location of symbol related to previous warning)
tmp7AA1.cs(88967,31): error CS0246: The type or namespace name 'INotifyPropertyChanging' could not be found (are you missing a using directive or an assembly reference?)
tmp7AA1.cs(88967,56): error CS0246: The type or namespace name 'INotifyPropertyChanged' could not be found (are you missing a using directive or an assembly reference?)
tmp7AA1.cs(13,14): error CS0426: The type name 'Collections' does not exist in the type 'System'
tmp7AA1.cs(14,7): warning CS0437: The type 'System' in '...\AppData\Local\Temp\tmp7AA1.cs' conflicts with the imported namespace 'System' in 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Configuration.dll'. Using the type defined in '...\AppData\Local\Temp\tmp7AA1.cs'.
tmp7AA1.cs(88967,22): (Location of symbol related to previous warning)
c:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Configuration.dll: (Location of symbol related to previous warning)
tmp7AA1.cs(14,14): error CS0426: The type name 'ComponentModel' does not exist in the type 'System'
依此类推, 116460行!
我可以连接到SSMS中的每个服务器以验证这些连接字符串是否有效。这就是我所看到的:
SQL_05
是版本10.0.2531(SQL Server 2008)SQL_08
是版本10.0.2500(SQL Server 2008)SQL_10
是版本10.50.4286(SQL Server 2008 R2)除此之外,我看不出三台服务器之间有什么区别。这里有什么我想念的吗?我是否需要添加一些引用才能为此特定服务器创建类型提供程序?