为什么当前平台不支持“资源池”?
-
09-06-2019 - |
题
出现以下异常的可能原因是什么?
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上测试没有任何问题。但是,了解导致此异常的原因(无论平台如何)会很有趣。
解决方案
我使用 Reflector 查看了源代码,但似乎在 ResourcePool 的静态构造函数中找不到对 Platform.Assert 的任何调用。
Windows 2003服务器是64位的吗?这可能就是问题所在。
不隶属于 StackOverflow