MSDTC Service的访问权限
最近用ASP.NET做的CRM系统,BLL采用了TransactionScope来处理事务。因此,引发了一些关于TransactionScope的错误,所以在此总结一下错误类型和解决办法。
异常一、
1、异常信息如下:
异常信息为: 已禁用对分布式事务管理器(MSDTC)的网络访问。请使用组件服务管理工具启用 DTC 以便在 MSDTC 安全配置中进行网络访问。
---- Stack Trace ----
at System.Transactions.Oletx.OletxTransactionManager.ProxyException(COMException comException)
(dll file): Native Code offset:184041
at System.Transactions.TransactionInterop.GetOletxTransactionFromTransmitterPropigationToken(Byte[] propagationToken)
(dll file): Native Code offset:293
at System.Transactions.TransactionStatePSPEOperation.PSPEPromote(InternalTransaction tx)
(dll file): Native Code offset:78
at System.Transactions.TransactionStateDelegatedBase.EnterState(InternalTransaction tx)
(dll file): Native Code offset:177
at System.Transactions.EnlistableStates.Promote(InternalTransaction tx)
(dll file): Native Code offset:15
at System.Transactions.Transaction.Promote()
(dll file): Native Code offset:61
at System.Transactions.TransactionInterop.ConvertToOletxTransaction(Transaction transaction)
(dll file): Native Code offset:46
at System.Transactions.TransactionInterop.GetExportCookie(Transaction transaction, Byte[] whereabouts)
(dll file): Native Code offset:193
at System.Data.SqlClient.SqlInternalConnection.GetTransactionCookie(Transaction transaction, Byte[] whereAbouts)
(dll file): Native Code offset:35
at System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction tx)
(dll file): Native Code offset:450
at System.Data.SqlClient.SqlInternalConnection.Enlist(Transaction tx)
(dll file): Native Code offset:4846418
at System.Data.SqlClient.SqlInternalConnectionTds.Activate(Transaction transaction)
(dll file): Native Code offset:4846477
at System.Data.ProviderBase.DbConnectionInternal.ActivateConnection(Transaction transaction)
(dll file): Native Code offset:33
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
(dll file): Native Code offset:1286
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
(dll file): Native Code offset:65
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
(dll file): Native Code offset:117
at System.Data.SqlClient.SqlConnection.Open()
(dll file): Native Code offset:122
2、原因分析:
这个异常的原因是因为MSDTC设置不正确引起的。
3、解决办法:
3.1 检查防火墙
如果防火墙是关的,那就不用再设置了。如果防火墙是开的,那么确保msdtc.exe是在它的例外里,一般这个程序是在C:\Windows\System32 \msdtc.exe这个角落。有时候你会发现在防火墙的例外里添加了msdtc,还是不行,那有可能是跟一个端口有关系,即135端口,这是个RPC端口,在出错的时候,可以尝试将该端口也添加到防火墙的例外里。
3.2 数据库打补丁
如果数据库服务器是sql2000,那么确保已经打了sp4补丁。
如果数据库是sql2005,那么最好把sq2 补丁打上。
3.3 “管理工具”-“组件服务”-“计算机”-“我的电脑”,右键“我的电脑”,选择“属性”-“MSDTC”-“安全配置”,参照如下设置:
异常二、
1、异常信息如下:
异常信息为: 拒绝访问。 (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))。
---- Stack Trace ----
at System.Transactions.Oletx.IDtcProxyShimFactory.ConnectToProxy(String nodeName, Guid resourceManagerIdentifier, IntPtr managedIdentifier, Boolean& nodeNameMatches, UInt32& whereaboutsSize, CoTaskMemHandle& whereaboutsBuffer, IResourceManagerShim& resourceManagerShim)
(dll file): Native Code offset:0
at System.Transactions.Oletx.DtcTransactionManager.Initialize()
(dll file): Native Code offset:178
at System.Transactions.Oletx.DtcTransactionManager.get_ProxyShimFactory()
(dll file): Native Code offset:71
at System.Transactions.TransactionInterop.GetOletxTransactionFromTransmitterPropigationToken(Byte[] propagationToken)
(dll file): Native Code offset:180
at System.Transactions.TransactionStatePSPEOperation.PSPEPromote(InternalTransaction tx)
(dll file): Native Code offset:84
at System.Transactions.TransactionStateDelegatedBase.EnterState(InternalTransaction tx)
(dll file): Native Code offset:190
at System.Transactions.EnlistableStates.Promote(InternalTransaction tx)
(dll file): Native Code offset:18
at System.Transactions.Transaction.Promote()
(dll file): Native Code offset:69
at System.Transactions.TransactionInterop.ConvertToOletxTransaction(Transaction transaction)
(dll file): Native Code offset:46
at System.Transactions.TransactionInterop.GetExportCookie(Transaction transaction, Byte[] whereabouts)
(dll file): Native Code offset:193
at System.Data.SqlClient.SqlInternalConnection.GetTransactionCookie(Transaction transaction, Byte[] whereAbouts)
(dll file): Native Code offset:20
at System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction tx)
(dll file): Native Code offset:463
at System.Data.SqlClient.SqlInternalConnection.Enlist(Transaction tx)
(dll file): Native Code offset:133
at System.Data.SqlClient.SqlInternalConnectionTds.Activate(Transaction transaction)
(dll file): Native Code offset:5004909
at System.Data.ProviderBase.DbConnectionInternal.ActivateConnection(Transaction transaction)
(dll file): Native Code offset:36
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
(dll file): Native Code offset:1211
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
(dll file): Native Code offset:108
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
(dll file): Native Code offset:126
at System.Data.SqlClient.SqlConnection.Open()
(dll file): Native Code offset:125
at FengYun.FYCRM.DBUtility.DbHelperSQL.PrepareCommand(SqlCommand cmd, SqlConnection conn, SqlTransaction trans, String cmdText, SqlParameter[] cmdParms)
(dll file): Native Code offset:92
at FengYun.FYCRM.DBUtility.DbHelperSQL.ExecuteSql(String SQLString, SqlParameter[] cmdParms)
(dll file): Native Code offset:164
at FengYun.FYCRM.DAL.RoleOfUserDAL.Add(RoleOfUserInfo model)
(dll file): Native Code offset:1191
at FengYun.FYCRM.BLL.UserInfoBLL.Add(UserInfo model)
(dll file): Native Code offset:791
at FengYun.FYCRM.WebUI.SystemManager.UserAdd.btnSave_Click(Object sender, EventArgs e)
(dll file): Native Code offset:3159
2、原因分析:
首先, 通过上述StackTrace可以确认,问题还是出在DTC。
通过一些关键字Google了一下,原来这个问题是因为MSDTC对Authenticated Users的权限设定成(A;;CR;;;AU),而它正确地设定应该是(A;;CCLCSWRPLOCRRC;;;AU),权限解释可以参照ACE Strings。
3、解决办法:
3.1 如何查看和设定MSDTC的权限呢,首先,在DOS窗口键入“sc sdshow msdtc”,查询MSDTC现在的权限设置,如下图:
3.2 从上图可以看出,这台服务器确实将Authenticated Users的权限设定成(A;;CR;;;AU),我们只需要将(A;;CR;;;AU)修改为(A;;CCLCSWRPLOCRRC;;;AU),就可以解决问题,如下图:
3.3 DOS窗口下,“IISRESET”重启IIS。
MSDTC Service的访问权限相关推荐
- [转]Reporting Service部署之访问权限
本文转自:https://www.cnblogs.com/lonelyxmas/p/4112638.html 原文: Reporting Service部署之访问权限 SQL Server Repor ...
- Linux下SVN服务器同时支持Apache的http和https及svnserve独立服务器三种模式且使用相同的访问权限账号...
1.在服务器上安装配置SVN服务: 2.配置SVN服务同时支持Apache的http和svnserve独立服务器两种模式访问: 3.Apache的http和svnserve独立服务器两种模式使用相同的 ...
- 关于如何在你的Web项目中实现对空间数据访问权限的控制(一)
Wednesday, 23 JUNE 近来一直在研究关于如何在我的WebGIS项目中实现对空间数据(已发布在GeoServer上)进行权限管理的问题.虽然到目前为止没能找到一个完美的解决方案,但通过这 ...
- Powershell管理系列(十一)Exchange完全访问权限邮箱的设置
-----提供AD\Exchange\Lync\Sharepoint\CRM\SC\O365等微软产品实施及外包,QQ:185426445.电话18666943750 首先说明下一些赋予及取消完全访问 ...
- 如何添加团队成员,并为团队成员分配访问权限(转载)
转自http://www.cnblogs.com/ajiefj/archive/2010/04/20/1716655.html 首先要把现有开发人员添加到TFS中,第一步就是要让他拥有TFS成员资格, ...
- android动态访问权限,android – Firebase规则:动态授予特定用户访问权限
在客户端 你可以use custom File Metadata.它的作用是添加一个Map< String,String>到文件的元数据.由于Map中的键是唯一的,因此您可以将用户B的id ...
- Nagios 请检查HTTP服务器关于该CGI的访问权限设置
无权查看任何主机的信息. 请检查HTTP服务器关于该CGI的访问权限设置. 搜索了一下方法 确保 htpasswd.user的所有组为nagios 解决办法: vi /usr/local/nagios ...
- 在Kubernetes Pod中使用Service Account访问API Server
2019独角兽企业重金招聘Python工程师标准>>> 在Kubernetes Pod中使用Service Account访问API Server 博客分类: Kubernetes ...
- android程序root权限,android – 如何从源代码授予对特定应用程序的root访问权限而不是root权限?...
我正在从源代码编译Android ROM,我有一个应用程序,我希望它预先安装并让它以root权限运行. 如何在不支持整个ROM的情况下授予对此特定应用程序的root访问权限? 解决方法: 希望你不需要 ...
最新文章
- Apache Kylin v2.5.0正式发布,开源分布式分析引擎
- 苹果怎样运行低版本php,Mac如何安装多个php版本
- Golang的for range遍历
- CentOS7 64位下MySQL5.7安装与配置(YUM)
- 系统开发小结【未完待续】
- Google AI 教育项目今起免费开放,支持中文
- 2.1 全连接神经网络
- s3c2440的pwm输出
- 如何在SqlServer中获取前端连接的IP地址,计算机名等信息
- 批量修改所选文件夹中所有文件的名称
- 2022软件库iAPP源码前端/后端程序整套独立后台
- linux为mysql创建gpower_mysql在linux下的安装
- 概率论与数理统计——卡方分布的期望与方差
- 遇到oracle错误20001,请问ORA-20001错误该如何解决,倒入倒出碰到的。。。
- anguarjs 上传图片预览_前端战五渣学前端——FileReader预览本地文件
- python怎么转义_python怎么转义
- python练习题(3)--字符串及正则表达式的应用
- 文章分享-七巧板拼凸多边形-PAUL SCOTT tangrams
- BufferedStream
- 安卓工作室 android studio 的 汉化 美化 定制 Android studio's Chinesization beautification customization
热门文章
- Mac提示mysql不是_mysql插入汉字报错。不是mysql是安装在mac系统里的
- 正和游戏:加密协议正在重塑公共产品 |链捕手
- python配什么数据库_[宜配屋]听图阁
- 【已修复】windows10更新:你的设备中缺少重要的安全和质量修复。
- 海洋环境科学概论知识整理--2
- 安卓——RecyclerView使用(最新版)面向小白,要多白就有多白
- Java 工程师,掌握这些,你离大神只差一步
- ElasticSearch数据分片-数据路由
- Struts2遇到的一个bug(对于与上下文路径[/WebStruts2.3]关联的名称空间[/]和动作名称[hello],没有映射的Action。)
- shopee商家入驻需要什么条件?注册虾皮shopee网店其实非常简单