如何更新 SharePoint 服务器场中每个 WFE 上的 web.config? [英] How to update web.config on each WFE in a SharePoint server farm?

查看:43
本文介绍了如何更新 SharePoint 服务器场中每个 WFE 上的 web.config?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个包含多个 WFE 的 SharePoint 场.一个新的应用程序要求我们在部署期间向 web.config 编写一些自定义代码.在部署期间修改 web.config 文件以确保场中的每个 WFE 得到更新的最佳方法是什么?

We have a SharePoint farm with multiple WFEs. A new application requires us to write some custom code to the web.config during deployment. What is the best way modify the the web.config file during deployment, ensuring that each WFE in the farm get updated?

推荐答案

我假设您将通过 WSP 部署您的代码;如果没有,使用像 WSPBuilder 这样的工具是一个很好的起点,它可以让您在不强迫您的情况下开始工作了解解决方案包构建的所有复杂细节.

I'm assuming you'll be deploying your code via a WSP; if not, using a tool like WSPBuilder is a great starting place that allows you to get rolling without forcing you to learn all of the intricate details of solution package construction.

您应该利用 SPWebConfigModification 自定义 SPFeatureReceiver 中的类型.通常,SPFeatureReceiverFeatureActivated 方法将被编码为将更改写入受激活影响的 web.config 文件.然后将在 FeatureDeactivation 方法中撤回这些相同的更改.

You should leverage the SPWebConfigModification type from within a custom SPFeatureReceiver. Normally, the FeatureActivated method of the SPFeatureReceiver would be coded to write the changes out to the web.config files impacted by your activation. Those same changes would then be retracted in the FeatureDeactivating method.

SPWebConfigModification 类型的好处在于,SharePoint 负责确定应修改哪些 web.config 文件 - 跨服务器和跨扩展的 Web 应用程序.

The nice thing about the SPWebConfigModification type is that SharePoint takes care of determining which web.config files should be modified -- across servers and across extended web apps.

我希望这会有所帮助!

这篇关于如何更新 SharePoint 服务器场中每个 WFE 上的 web.config?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆