none
Refresh webconfig from Event receiver

    질문

  • 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.

    2012년 6월 15일 금요일 오후 5:36

답변

  • 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

    • 답변으로 표시됨 Shimin Huang 2012년 6월 29일 금요일 오전 6:37
    2012년 6월 18일 월요일 오전 6:19

모든 응답

  • 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

    • 답변으로 표시됨 Shimin Huang 2012년 6월 29일 금요일 오전 6:37
    2012년 6월 18일 월요일 오전 6:19
  • Hi, Pwl,

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


    LinkedIn Profile

    2012년 6월 18일 월요일 오전 6:28