作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这个(嵌套Installer)有区别吗
ServiceInstaller si = new ServiceInstaller();
si.ServiceName = "MyService";
ServiceProcessInstaller spi = new ServiceProcessInstaller();
spi.Account = ServiceAccount.LocalSystem;
spi.Installers.Add(si);
this.Installers.Add(spi);
还有这个? (事务安装程序)
TransactedInstaller ti = new TransactedInstaller();
ServiceInstaller si = new ServiceInstaller();
si.ServiceName = "MyService";
ti.Installers.Add(si);
ServiceProcessInstaller spi = new ServiceProcessInstaller();
spi.Account = ServiceAccount.LocalSystem;
ti.Installers.Add(spi);
this.Installers.Add(ti);
默认情况下嵌套的安装程序是否被处理?应该首选哪种样式?
最佳答案
如果自定义操作成功/失败,
TransactedInstaller 将自动调用 Commit/Rollback。
使用嵌套安装程序,您需要在出现错误的情况下对回滚/提交进行排序,如果您没有明确告知,它们将不会被调用他们跑。
关于c# - TransactedInstaller 与嵌套安装程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/692986/
这个(嵌套Installer)有区别吗 ServiceInstaller si = new ServiceInstaller(); si.ServiceName = "MyService"; Serv
我是一名优秀的程序员,十分优秀!