« Previous Next »

Thread: Run msdeploy.exe through ASP.net

Last post 01-22-2009 2:01 PM by dbuggs. 3 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (4 items)

Sort Posts:

  • 12-04-2008, 7:50 PM

    • anjee
    • Top 500 Contributor
    • Joined on 11-28-2008, 9:44 PM
    • Posts 17

    Run msdeploy.exe through ASP.net

    Hi All,

    I am experiencing weird hard behavior while trying to run msdeploy.exe through ASP.net web form.

     

    What I am doing

     

    Step1:

    Installed x86_msdeploy_beta2.msi on windows server 2003 and manually started “Web Deployment Agent Service”.

     

    Step2

    Created asp.net webapp and published to same server  with virtual directory named as migrationtool and created application pool for same with indentity which has administrator rights.

    On archive button click event I am trying to execute the following code to run msdeploy.exe

    Process msdeployprocess = new Process();             msdeployprocess.StartInfo.FileName = @"C:\Program Files\IIS\Microsoft Web Deploy\msdeploy.exe";             msdeployprocess.StartInfo.WorkingDirectory =  @"C:\Program Files\IIS\Microsoft Web Deploy";

                msdeployprocess.StartInfo.Arguments = "-verb:sync -source:metakey=/LM/w3svc/1/ROOT/virdirabc,computername=machine1.xxx.org-dest:archivedir=C:\archive\virdirabc -debug

    "          msdeployprocess.StartInfo.UseShellExecute = false;            msdeployprocess.StartInfo.CreateNoWindow = true;            msdeployprocess.StartInfo.RedirectStandardOutput = true;            msdeployprocess.StartInfo.RedirectStandardError = true;                      msdeployprocess.Start();            msdeployprocess.WaitForExit(6000);//1min 

    What I am expecting

    Archive virtual directory settings and content for  a given virdirabc.

    What it is doing

    It is archiving only virtual directory settings and partial content(not copying entire content from source content directory to archive content directory). It is behaving very weird as it is copying child level items not root level items.

    NOTE: If I run the same command through command line on same server then it is archiving all virtual directory settings as well as content.

    F:\>msdeploy -verb:sync -source:metakey=/LM/w3svc/1/ROOT/virdirabc,computername=machine.xxx.org

     -dest:archivedir=C:\archive\virdirabc–debug

      

    Can any one try to reproduce the same? Am I missing some thing?

    Thanks in advance for your help.

     Anjee. 

     

  • 12-09-2008, 3:54 PM In reply to

    Re: Run msdeploy.exe through ASP.net

    Can you get the output of the process?

    Also, are you sure the msdeploy command is even executing successfully through your web app? One possibility I could see is that you're looking at an old archive and that the command is failing due to insufficient privileges.

    Any additional information you have would be useful. Thanks!

    -Nina

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • 12-23-2008, 2:48 PM In reply to

    • anjee
    • Top 500 Contributor
    • Joined on 11-28-2008, 9:44 PM
    • Posts 17

    Re: Run msdeploy.exe through ASP.net

    Hi Nina,

    Thanks for attemping my thread.

    [are you sure the msdeploy command is even executing successfully through your web app?]

    Yes, msdeploy command is executing successfully and it is creating whole directory sctructure but not copying content.

    [One possibility I could see is that you're looking at an old archive]

    No, I am looking at right directory because every time I deleting directory structure manually before executing.

    I am not receiving any exit code from Process but as you said there might be insufficient privileges(I coudn't find what>..)

    Thanks,
    Anjee.

     

     

  • 01-22-2009, 2:01 PM In reply to

    • dbuggs
    • Not Ranked
    • Joined on 01-22-2009, 1:58 PM
    • Posts 1

    Re: Run msdeploy.exe through ASP.net

    A quick and dirty way to eliminate the insufficient privileges issue is to change the account that the app pool runs under to an admin account for a quick test.

Page 1 of 1 (4 items)
Microsoft Communities