在程序中,使用Microsoft.SqlServer.Management.Common空间下的ServerConnection类时,在创建它的实例时出现了如标题所示的错误。查找了一些资料,有人说是config文件配置有问题。在我的config文件中有如下配置:
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
<requiredruntime version="v4.0.30319" />
</startup>
<configSection>
<Section name="MM" type="....."/>
</configSection>
<MM>
<any name="ss"/>
</MM>
如果把这段配置去掉就可以正确创建ServerConnection对象。或者把configSection的配置却掉也能正常运行。请问这是什么原因造成的?
我添加上面的配置原因是用于解决“mixed mode"异常的。因为在使用smo的事务管理时,当调用ServerConnection.BegionTransaction()方法时,总是出现异常”Mixed mode assembly........"。到底smo的事务管理是如何使用的?
慕标5832272
陪伴而非守候