.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan
Santhakumar Munuswamy
Fauzul Azmi
Asad Ali
Post New Web Links

Process (System.Diagnostics.Process) invoked by aspx hangs on iis6 / win2003

Posted By:      Posted Date: September 13, 2010    Points: 0   Category :.NET Framework
 
Hello all, I've encountered a problem trying to run an external exe from an aspx page. My code works fine when running under visual studio and also when running under iis7 on windows server 2008 SP1. It does not work on iis6 on windows 2003 sp2: 1. The executable is loaded and uses 560k or so of memory 2. The executable does not use any cpu 3. The executable does not appear to enter Main()  4. The invoking code hangs at WaitForExit() I've tried using different executables including a dummy that simply returned and that did not make any difference. I'm pretty sure that the credentials being used for the executable are correct because if I fudge the password, the process reports a login failure. I'm pretty sure that output blocking to the standard out and standard error streams is not the issue as a) it works on iis7 and b) when I first suspected this as the cause, I re-wrote the aspx to launch threads to read the streams. I've tried invoking my exe directly and via cmd.exe and that makes no difference. Anyway, if anyone has any ideas on this, it would be greatly appreciated. I've included a snippet of my code below. Thanks in advance... ...Beau                     // Create a new process to invoke the console app                     usi


View Complete Post


More Related Resource Links

Issue on System.Diagnostics.Process output

  
I am getting the following error message System.InvalidOperationException: StandardOut has not been redirected or the process hasn't started yet. for the below code which has to displays the Output of the command prompt command: Process p = new Process(); string result = ""; p.StartInfo.WorkingDirectory = "C:\\WINDOWS\\system32"; p.StartInfo.FileName = "cmd.exe"; p.StartInfo.UseShellExecute = false; p.StartInfo.CreateNoWindow = true; p.StartInfo.RedirectStandardInput = true; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.Arguments = "/C ipconfig"; StreamReader stdOut = p.StandardOutput; p.WaitForExit(); p.Start(); result = stdOut.ReadToEnd(); if (!p.HasExited) { p.Kill(); } stdOut.Close(); p.Close(); Response.Write(result); System.Threading.Thread.Sleep(5000); Please help guys. Is I am doing correct. 

System.Diagnostics.Process.Start not work with IIS, but on ASP.NET Development Server

  
System.Diagnostics.Process.Start not work with IIS, but on ASP.NET Development Server 

System.Diagnostics.Process and Acrobat Reader

  
If I already have any PDF file being displayed in Adobe Reader, making the call System.Diagnostics.Process proc = Launch(sUniqueName, sPath, true, m_iWaitNone), then immediately examining proc.HasExited would indicate true, although the "sUniqueName" PDF would still be open.  This can't be correct!?

If I don't have any PDF files open before making the call, "sUniqueName" would be open, and examining proc.HasExited would indicate false... which is correct.  This is very repeatable.  Why would proc.HasExited = true when the PDF is still being displayed just because another PDF was opened prior to the call?

Thanks for any insight... this is driving me crazy!   :-P

-Don

-------------

Code follows:

      #region Launch()
        public System.Diagnostics.Process Launch(string sFilename, string sArgs, bool bCreateWindow, int iWaitMode)
        {
            const int ERROR_FILE_NOT_FOUND = 2;
            const int ERROR_ACCESS_DENIED = 5;

            System.Diagnostics.Process proc =

Team System: Streamline Team Projects With Process Templates

  

See how you can streamline your team projects using Process Templates in Visual Studio Team System (VSTS)

Brian A. Randell

MSDN Magazine December 2008


Around the Horn: Engineer a Distributed System Using .NET Remoting for Process Intensive Analysis

  

Before the Microsoft .NET Framework, creating a distributed cluster of computers to perform scientific analysis was expensive in terms of hardware, programming and debugging time, and maintenance. You had to purchase expensive servers, spend time debugging network communication, design a distributed system completely different from a system deployed locally, and maintain a melting pot of error handling, data acquisition, networking, and analysis code. In this article, the author shows you how he was able to engineer a distributed computing system in C# to perform analysis of real-world data continuously acquired at high sampling rates, thanks to the .NET Framework.

Nate D'Anna

MSDN Magazine May 2005


System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> Object canno

  
hello,i am using a web servicewrtitten in .net and i access the webservice from my wepApplication i get this error System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> Object cannot be cast from DBNull to other types.my code is access webservice: protected void btnSave_Click(object sender, EventArgs e)        {            int intStatusCode;            dtProjectStatus = (DataTable)ViewState["dtProjectStatus"];            try            {                objService.Credentials = System.Net.CredentialCache.DefaultCredentials;                if(dtProjectStatus.Rows.Count>0)                {                  intStatusCode = objService.InsertTest(dtProjectStatus);                }   

How to SDelete from a System.Diagnostic.Process with no warning prompt

  
I have a need to securely delete files once my process is finished with them.  I have to write a file to disk, so another process can read it and process it.  It is not an option to simply write it to a stream because I have no control over the consumer of the file. So, I found the SDelete tool Sysinternals which should solve my problem nicely.  I wrappered that with the following static method in my Utility library: public static void SecureDelete(string fullyQualifiedFileName, string domain, string user, SecureString pswd) { // // This does not appear to be working properly... // it works under the debugger, but not when running as a service // using (System.Diagnostics.Process p = new System.Diagnostics.Process()) { p.StartInfo.FileName = "sdelete"; p.StartInfo.Arguments = string.Format("-q {0}", fullyQualifiedFileName); p.StartInfo.CreateNoWindow = true; p.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; p.StartInfo.RedirectStandardOutput = false; p.StartInfo.UseShellExecute = false; p.StartInfo.Domain = domain; p.StartInfo.UserName = user; p.StartInfo.Password = pswd; p.Start(); } } The problem is that when I run under the debugger (using my credentials) it works fine, but this code is called from a service which runs under the Network Service account, so

FCB::Open: Operating system error 32(The process cannot access the file because it is being used by

  
Hello all,I am running into an interesting scenario on my desktop.  I'm running developer edition on Windows XP Professional (9.00.3042.00 SP2 Developer Edition).  OS is autopatched via corporate policy and I saw some patches go in last week.  This machine is also a hand-me-down so I don't have a clean install of the databases on the machine but I am local admin.So, starting last week after a forced remote reboot (also a policy) I noticed a few of the databases didn't start back up.  I chalked it up to the hard shutdown and went along my merry way.  Friday however I know I shut my machine down nicely and this morning when I booted up, I was in the same state I was last Wenesday.  7 of the 18 databases on my machine came up withFCB:pen: Operating system error 32(The process cannot access the file because it is being used by another process.) occurred while creating or opening file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\Test.mdf'. Diagnose and correct the operating system error, and retry the operation.and it also logs  FCB:pen failed: Could not open file C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\Test.mdf for file number 1. OS error: 32(The process cannot access the file because it is being used by another process.).I've caught references to the auto close feature being a possible culprit, no dice as the databases in question are set to Fal

The process could not be created for step 1 of job .....(reason: The system cannot find the file spe

  

Hi ,

I was trying your options by using "(operating system) cmdExec" to delete folders which were 15 days olders.  But here i am getting error if i look into view history of sql agent job... below is my command that i gave in Job step.

EXEC xp_cmdshell 'forfiles /p "z:\backup" -d 15 /c "cmd /c if @isDir==True echo RD /Q /S @FILE&RD /Q /S @FILE"'

And the error is :

The process could not be created for step 1 of job .....(reason: The system cannot find the file specified).  The Step failed.

but if i give this command in New Query Window, i am able to delete the folders successfully.

Please advice me if am wrong

R Anand


The current process has used all of its system allowance of handles for Window Manager objects

  

hello,

I get an error message which says like "The current process has used all of its system allowance of handles for Window Manager objects" that i dont know what it its. I have winForm project and it works fine but after sometime it raised this error.

I really need help on this.

 


run system.dioganistic.process to open notepad not work on production server

  

Hi I have try to open notepad from local machine test code thats work fine, but when I try the code in production server my code not open the note pad.

this is the code I am using

System.Diagnostics.Process.Start("notepad")

I have change .netframework >> config >> machine.config file <processModel to username="System" and password"Autogenerate"

even though this is not working then i create a individual application pool for this application , and set identity tab Predefine value to "Network service" value to "local service" and then "local system" non of these not run the process from vb.net code.

how do I solve this. I have seen one article says need to change IIS  logon tab to allow interact with desktop, but i cannot find this feature in IIS.

anybody to help me please......

thanks


Error warming up the worker process. - Starting worker process threw - Inner Exception: System.Runti

  

Can anybody guide me how to resolve this on my production server,

 

 

Error warming up the worker process. - Starting worker process threw - Inner Exception: System.Runtime.Remoting.RemotingException: 4 arguments were passed to 'Microsoft.SharePoint.UserCode.ISPUserCodeWorkerProcessProxy::Initialize'. 3 arguments were expected by this method.    Server stack trace:      at System.Runtime.Remoting.Messaging.Message.CoerceArgs(MethodBase mb, Object[] args, ParameterInfo[] pi)     at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)    Exception rethrown at [0]:      at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)     at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)     at Microsoft.SharePoint.UserCode.ISPUserCodeWorkerProcessProxy.Initialize(Int32 appDomainCount, Boolean alwaysRecycleAppDomains, Byte[] salt, Boolean logRequests)     at Microsoft.SharePoint.UserCode.SPUserCodeWorkerProcess.InitializeWorkerProcess(ISPUserCodeWorkerProcessProxy workerProcessProxy, Boolean alwaysRecycleAppDomains, Byte[] saltBytes, Boolean logRequests)     at Microsoft.SharePoint.UserCode.

Error warming up the worker process. - Inner Exception: System.Runtime.Remoting.RemotingException: 4

  
Can anybody guide me how to resolve this,


10/16/2010 01:50:32.39 SPUCHostService.exe (0x0AA4)             0x0D9C SharePoint Foundation         Sandboxed Code Service         fe8d Medium   -  - Error warming up the worker process. - Inner Exception: System.Runtime.Remoting.RemotingException: 4 arguments were passed to 'Microsoft.SharePoint.UserCode.ISPUserCodeWorkerProcessProxy::Initialize'. 3 arguments were expected by this method.    Server stack trace:      at System.Runtime.Remoting.Messaging.Message.CoerceArgs(MethodBase mb, Object[] args, ParameterInfo[] pi)     at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)    Exception rethrown at [0]:      at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)     at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData,

Deadlock: System.Data.SqlClient.SqlException: Transaction (Process ID 51) was deadlocked on lock res

  

 Hello,

 

I have a deadlock problem that occurs every 5 minutes on SQL update. I get the following error randomly - means qurey failed one time every 200 calls. I'm using transaction scope to manage transaction.

 

 

code:

using(TransactionScope scope = new TransactionScope())

{

     SELECT ... FROM TABLE1

 

     UPDATE TABLE1 SET [F1] = @F1, [F2] = @F2, [F3] = @F3, [F4] = @F4, [F5] = @F5 WHERE UId = @UId

 

 

      scope.Complete();

}

 

 

error:

System.Data.SqlClient.SqlException: Transaction (Process ID 51) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction

 

stack tr

System.Management WMI Remote Process start

  

 

Couple questions here, some of which depends on the answer of other questions.....fun stuff   

 

1) So I have a program that starts a remote process on a PC. When trying to run this program, it's a VBscript it's attempting to run, I get a response code of "8" which is an unknown error. Can you run VBscripts using the System.Management class and WMI?

 

2) This Vbscript is launching iexploer.exe and browsing to a designated webpage. Instead of using the VBscript can I start iexploer.exe [I know I can do this] but pass it arguments so it starts at a certain webpage?

 

3) Even if I can do option 2, which is preferable, I'm having a problem with even launching iexploer.exe. On the remote PC it starts the process, but it never is shown. It appears as if it's running in the background but have no visuals of the application whatsoever. This occurs no matter what I run: notepad.exe, calc.exe, cmd.exe....you name it. Again, I see the process start [task manager] but no visual representation of that program.

System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> Index was ou

  

Dear All,

I am using a client program(c#) which calls the web service.

I am getting the below error:

System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> Index was outside the bounds of the array.
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at KrtoPGMSSQLWebServiceClient.rtowebservice.Service.PostGreDataSync(String StrNonQuery, Byte[] byteRowTimestamp, String TableName, Int32 strUniId, String strRemoteCode)
   at KrtoPGMSSQLWebServiceClient.ManipDataExportClient.InsertManipData(DataSet ManipTablesDS) 

KrtoPGMSSQLWebServiceClient--is namespace name

ManipDataExportClient--is class name

InsertManipData--is function name (which calls the DataSet  ManipTablesDS)

 

I want to know that  whether i am getting this error at the time of calling web service or while accessing web service and why.

Plzzzz help me solve this...

Thank You


system.diagnotics.process Cannot work after Impersonate set to True

  

Dear All proferssional,

I need all ur help, i new in Visual Studio, currently just doing some modification on other person project due to some security issues. This application can run fine before i set the Impersonate to true in Web.Config, but after i set Impersonate = true, i get this information in Event Log

Faulting application java.exe, version 6.0.210.7, faulting module ntdll.dll, version 5.2.3790.3959, fault address 0x000000000003a7c0

In web.config, i set this tag

<identity impersonate="true" />

And inside my login screen, the below code have apply

        Dim strArgu As String = ""
        Dim processJar = New System.Diagnostics.Process()
        strArgu = " -classpath cryptcare.jar;commons-codec-1.3.jar com.maybank.care.ldapcontrols.LDAPConnector ""LOGON""" & " " & txtPFNo.Text.Trim() & " " & txtPwd.Text.Trim()

        processJar.StartInfo.FileName = "java"
        processJar.StartInfo.CreateNoWindow = True
        processJar.StartInfo.Arguments = strArgu
        processJar.StartInfo.WorkingDirectory = strWorkingDir
        processJar.StartInfo.UseShellExecute = False
        processJar.StartInfo.RedirectStandardOutput = True
        processJar.startInfo.UserName() = Syste
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend