Finding the Web.config file of SharePoint Site Programatically (Sharepoint2010)
using System; using System.Collections.Generic; using System.Collections; using System.IO; using System.Linq; using System.Text; using Microsoft.SharePoint; using Microsoft.SharePoint.Administration; using System.Collections.ObjectModel; namespace ConsoleOperations { class SharepointWebConfigProgram { static void Main(string[] args) { using (SPSite oSite = new SPSite("http://localhost:5050")) { string physicalPath = oSite.WebApplication.IisSettings[SPUrlZone.Default].Path.ToString(); //Find the physical path of the Site Console.WriteLine(physicalPath + @"\web.config"); Console.ReadLine(); //Copying The Web.config file ...