关于TransactionScope 事务处理的问题,很烦恼!

bobo202020 2009-05-13 08:18:04
用TransactionScope 做分布式事务处理,确实很强大,很方便啊
但是有个问题始终得不到解决
代码写好后,运行出错,报错信息是MSDTC安全设置的问题
于是要到 控制面板 -> 管理工具 -> 组件服务 -> 计算机 -> 我的电脑 -> 右击->属性->msdtc->安全性配置
进行一下设置后,一切运行正常!
问题是,我客户端有很多很多电脑,我不可能去每天电脑这样去手动配置啊
怎样可以用代码解决?
有没有人碰到过此类问题,电脑里面的MSDTC安全设置是系统默认的设置,我看了几台电脑都是一样的,系统是xp
...全文
140 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
wuyq11 2009-05-13
  • 打赏
  • 举报
回复
cppfaq 2009-05-13
  • 打赏
  • 举报
回复
Enabling TIP on Windows 2003 and Windows XP SP2

There are two ways we can do this, one is via the windows UI and the other is via the registry. First I will describe the safer alternative.

1. From Administrative Tools open Component Services
2. Locate the Component Services node
3. Open the Component Services node and under which you will find the Computers node
4. Open the Computers node, here you will find the My Computer node.
5. Right click the My Computer node and select the Properties menu item.
6. No the My Computer Properties window should be open, locate the MSDTC tab and select it.
7. Near the bottom of the Tab Page you will see a button labeled Security Configuration. Click this button.
8. You should now have the Security Configuration dialog on the screen.
9. On this dialog ensure that the following check boxes are checked

a. Network DTC Access
b. Transaction Internet Protocol (TIP) Transactions


10. Leave the rest of the settings as they are and click OK, click OK on the properties dialog to dismiss the properties dialog. At this point DTC should restart automatically to enable the new options you have selected.

Now for the simple way to enable TIP support. We are going to fiddle in the registry so please read the standard MS disclaimer here regarding changing settings in the registry.

Open the following registry key in regedit.

HKEY_LOCAL_MACHINE\Software\Microsoft\MSDTC\Security

Under this key you will find a number of values, the ones we are interested in are

NetworkDtcAccess and NetworkDtcAccessTip. Ensure that both values are set to 1 and restart the MSDTC service either from the Services control panel applet or on the command line as follows.

C:>net stop msdtc

C:>net start msdtc


http://dotnetjunkies.com/WebLog/chris.taylor/articles/54503.aspx

110,537

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧