Which class should you use in FeatureReceiver1?

You have a Web application named WebApp1.

You have a Feature receiver named FeatureReceiver1. FeatureReceiver1 stores a connection string in the web.config file of WebApp1.

You need to ensure that when FeatureReceiver1 makes configuration changes to web.config, the changes are automatically replicated to all Web servers in the farm.

Which class should you use in FeatureReceiver1?

You have a Web application named WebApp1.

You have a Feature receiver named FeatureReceiver1. FeatureReceiver1 stores a connection string in the web.config file of WebApp1.

You need to ensure that when FeatureReceiver1 makes configuration changes to web.config, the changes are automatically replicated to all Web servers in the farm.

Which class should you use in FeatureReceiver1?

A.
SPDiagnosticsService

B.
SPPersistedObject

C.
SPWebConfigModification

D.
WebConfigurationManager

Explanation:
MNEMONIC RULE: “web.config modification = SPWebConfigModification”

To apply modifications that you define through the SPWebConfigModification class to the web.config files in the server farm, call the ApplyWebConfigModifications method on the current content Web service object, as follows: SPWebService.ContentService.ApplyWebConfigModifications

SPWebConfigModification Class
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spwebconfigmodification.aspx



Leave a Reply 0

Your email address will not be published. Required fields are marked *