Monday, April 28, 2008

Editing web.config Programmatically

Today after finishing the webpart development when the time came to deploy them, I realised that everytime I deploy these webparts on another server I have to add SafeControl in web.config manually again and again. Did some research and found some good articles. SPWebConfigModification is the class that we can use to modify the web.config file.

Mark Wagner has dotted down some good best practices to do this. Check here

Ted Pattison has also written some great details about the complete process to do it and he has also uploaded a sample feature to do this. Check here

And if you are still not satisfied then read more information about SPWebConfigModification on msdn

No comments: