以下异常的可能原因是什么?
System.PlatformNotSupportedException: 'ResourcePool' is not supported on the current platform.
at System.EnterpriseServices.Platform.Assert(Boolean fSuccess, String function)
at System.EnterpriseServices.Platform.Assert(Version platform, String function)
at System.EnterpriseServices.ResourcePool..ctor(TransactionEndDelegate cb)
at System.Data.SqlClient.ConnectionPool..ctor(DefaultPoolControl ctrl)
at System.Data.SqlClient.PoolManager.FindOrCreatePool(DefaultPoolControl ctrl)
at System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
该平台是Windows 2003 Server SP2。在Windows XP SP2上测试了相同的代码,没有任何问题。但是,无论平台如何,知道导致此异常的原因会很有趣。
答案 0 :(得分:1)
我使用Reflector探测了源代码,我似乎无法在ResourcePool的静态构造函数中找到对Platform.Assert的任何调用。
Windows 2003服务器是64位吗?这可能是问题所在。