none
Refresh webconfig from Event receiver

    Soru

  • is there a way to force the webconfig file to update changes made in the CONFIG folder when you deploy a project?

    basically run stsadm –o copyappbincontent from the Event receiver 


    SharePoint has been a humbling experience.

    15 Haziran 2012 Cuma 17:36

Yanıtlar

  • Hi,

    If you want to execute stsadm command in Event Receiver you can use this code

    Process oProcess = new Process();
    ProcessStartInfo oProcessInfo = new ProcessStartInfo();
    // here I am hardcoding the physical locatio nof the STSADM command.
    oProcessInfo.FileName = @"C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\BIN\STSADM.EXE";
    oProcessInfo.Arguments = "-o copyappbincontent";
    oProcess.StartInfo = oProcessInfo;
    oProcess.Start();
    oProcess.WaitForExit();

    You may change stsadm command flag as per your requirement.

    Thanks


    Satyam MCITP, MCPD

    • Yanıt Olarak İşaretleyen Shimin Huang 29 Haziran 2012 Cuma 06:37
    18 Haziran 2012 Pazartesi 06:19

Tüm Yanıtlar

  • Hi,

    If you want to execute stsadm command in Event Receiver you can use this code

    Process oProcess = new Process();
    ProcessStartInfo oProcessInfo = new ProcessStartInfo();
    // here I am hardcoding the physical locatio nof the STSADM command.
    oProcessInfo.FileName = @"C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\BIN\STSADM.EXE";
    oProcessInfo.Arguments = "-o copyappbincontent";
    oProcess.StartInfo = oProcessInfo;
    oProcess.Start();
    oProcess.WaitForExit();

    You may change stsadm command flag as per your requirement.

    Thanks


    Satyam MCITP, MCPD

    • Yanıt Olarak İşaretleyen Shimin Huang 29 Haziran 2012 Cuma 06:37
    18 Haziran 2012 Pazartesi 06:19
  • Hi, Pwl,

    There is a great article on msdn that could help you.


    LinkedIn Profile

    18 Haziran 2012 Pazartesi 06:28