Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change SharePoint extended web application's web.config file

Using the SharePoint API, how can I modify an extended webapp web.config file?

I have to do some changes in this file to specify the connection string, membershipprovider, etc... for using Forms Authentication.

Currently, I can change the "master" webapplication web.config file, but not the extended one.

Edited

I'm using Sp 2007. I'm already using SPWebConfigModification class to modify the parent webapp. Thoses modifications are propagated to the extended webapp. I have to change ONLY the extended one. But I don't find the way to do it.

What I'm trying to achieve, is to program a little wizard that:

  • Shows a WebApp list so the user can select one
  • Extend that selected webapp to a different zone
  • Configure that extended zone to use Forms Authentication

Thanks

like image 621
vIceBerg Avatar asked Nov 06 '22 23:11

vIceBerg


1 Answers

I got an answer form a blog.

In your case , you need to write a Web Application scoped feature which after you provision your site using your C# app, it is deployed to the newly-provisioned site and in the receiver of the feature you inject the required web.config settings because in that context configuration API is obtainable , but again bear the following in mind:

If you don’t use SPWebConfigModification class and either use ASP.NET 2.0 configuration API or your own mechanism , propagating changes across the farm is YOUR RESPONSIBILITY. If this happens on an standalone installation then you don;t need to be worried about this.

So it cannot be done externally. We have to do a feature in order to acheve this.

Thanks

like image 107
vIceBerg Avatar answered Nov 14 '22 05:11

vIceBerg