in

dotNet Umbria [DNU]

Il primo User Group in Umbria sul mondo .Net
Latest post 03-26-2008 7:14 PM by Pizzoni Alessio. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-25-2008 12:18 PM

    Access is denied - esecuzione processo da pagina aspx

    Ciao a tutti,

    abbiamo creato un modulo per la stampa in pdf con FOP , in locale è fantastico e tutto funziona bene (winXP), dopo aver messo tutto online il produzione su una macchina windows 2003 web edition il tutto restituisce l'errore incollato sotto. la cartella che contiene il .bat da lanciare è contenuta in una cartella su :

    D:\fop-0.94\fop.bat

    la cartella ho provato a dare tutto i permessi immaginabili, cmq anche con everyone da questo errore, ma come è possibile?

    girando per il web ho visto che è possibile usare anche :

    <identity impersonate="true"
              userName="<UserName>"
              password="<Password>"/>

    specificando l'utente non parte più l'applicazione , lasciando solo <identity impersonate="true"/> sempre access denied.

    Abbiamo provato anche a mettere username e password da codice sull'esecuzione del processo, ma niente da fare. Forse sbaglio utente?

     il server  è gestito dal PLESK io ho sempre usato l'utente generato e gestito da lui.

     

    Server Error in '/' Application.

    Access is denied

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.ComponentModel.Win32Exception: Access is denied

    Source Error:

    Line 153:            //process.StartInfo.Password = ConvertToSecureString("PD");
    Line 154:
    Line 155:            process.Start();
    Line 156:            process.WaitForExit();
    Line 157:            

    Source File: d:\inetpub\vhosts\e-dotto.net\subdomains\test\httpdocs\App_Code\Helpers\PDFFOHelper.cs    Line: 155

    Stack Trace:

    [Win32Exception (0x80004005): Access is denied]
       System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) +2097
       System.Diagnostics.Process.Start() +140
       PDFFOHelper.ExecuteFopCommand(String fo, String pdfFileName) in d:\inetpub\vhosts\e-dotto.net\subdomains\test\httpdocs\App_Code\Helpers\PDFFOHelper.cs:155
       PDFFOHelper.Fop(String fo, String& fileName) in d:\inetpub\vhosts\e-dotto.net\subdomains\test\httpdocs\App_Code\Helpers\PDFFOHelper.cs:111
       PDFFOHelper.Fop(String fo) in d:\inetpub\vhosts\e-dotto.net\subdomains\test\httpdocs\App_Code\Helpers\PDFFOHelper.cs:97
       PDFFOHelper.GeneratePDF(XmlDocument xmlDoc, String xsltFileName, Boolean deleteFoFile) in d:\inetpub\vhosts\e-dotto.net\subdomains\test\httpdocs\App_Code\Helpers\PDFFOHelper.cs:55
       eStudio_GeneraFatturaPDF.Page_Load(Object sender, EventArgs e) in d:\inetpub\vhosts\e-dotto.net\subdomains\test\httpdocs\eStudio\GeneraFatturaPDF.aspx.cs:50
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34
       System.Web.UI.Control.OnLoad(EventArgs e) +99
       System.Web.UI.Control.LoadRecursive() +47
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832

     

  • 03-26-2008 7:14 PM In reply to

    Re: Access is denied - esecuzione processo da pagina aspx

    abbiamo proseguito nel nostro intento di lanciare un .bat da pagina asp.net .

    utilizzando imporsonate e l'utente di root per il momento non restituisce più access denied.

    al momento però non esegue correttamente il file bat , ritornando come errore il seguente :

    exitcode = 1, abbiamo provato con un bat file contenente il seguente comando :

    dir *.* >pippo.txt

    che ovviamente se lanciato da command line restituisce un file di testo contenente la dir, se lanciato da pagina da c# restituisce cmq exitcode=1. La chiamata che abbiamo provato è la seguente :

     

    System.Diagnostics.
    ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo("d:\\fop-0.94\\xxx.bat");

    psi.RedirectStandardOutput = true;

    psi.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;

    psi.UseShellExecute = false;

    System.Diagnostics.Process listFiles;

    listFiles = System.Diagnostics.Process.Start(psi);

    System.IO.StreamReader myOutput = listFiles.StandardOutput;

    listFiles.WaitForExit(2000);

    if (listFiles.HasExited)

    {

    string output = myOutput.ReadToEnd();throw (new Exception(" errore:" + output + " - " + listFiles.ExitCode.ToString()));

    }

     

     

Page 1 of 1 (2 items)
dotNet Umbria 2007-2008
Powered by Community Server (Commercial Edition), by Telligent Systems