michael_hk Posted June 18, 2004 Posted June 18, 2004 Hi guys, I have developed a simple remoting app. It works fine in Debug mode, but when I want to run it in Release mode (press F5), it gives The parameter is incorrect when I call a method. How is going on? :confused: :confused: Thanks for your time. Michael Quote There is no spoon. <<The Matrix>>
Administrators PlausiblyDamp Posted June 18, 2004 Administrators Posted June 18, 2004 Could you post the relevant code? It makes it a lot harder to solve a problem when people have to guess what the calling and server code looks like. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
michael_hk Posted June 18, 2004 Author Posted June 18, 2004 Could you post the relevant code? It makes it a lot harder to solve a problem when people have to guess what the calling and server code looks like. The following code works in debug mode. Client: txtResult.Text = infoMan.getUserList(txtUserName.Text); Server: public string getUserList(string userName) { try { System.Diagnostics.ProcessStartInfo ps = new System.Diagnostics.ProcessStartInfo(); ps.FileName = @"C:\USERLIST.EXE"; ps.Arguments= userName; ps.RedirectStandardOutput=true; System.Diagnostics.Process p = new System.Diagnostics.Process(); ps.UseShellExecute=false; p.StartInfo=ps; p.Start(); string s = p.StandardOutput.ReadToEnd(); return s; } catch (Exception ex) { return ex.Message; } } Quote There is no spoon. <<The Matrix>>
Administrators PlausiblyDamp Posted June 18, 2004 Administrators Posted June 18, 2004 Is it failing on the client's call to the server or somwhere within the server code? If on the server do you know which line of code is failing? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
michael_hk Posted June 18, 2004 Author Posted June 18, 2004 Is it failing on the client's call to the server or somwhere within the server code? If on the server do you know which line of code is failing? I really have no idea..... After the call, infoMan.getUserList(txtUserName.Text), the textbox (txtResult) shows "The parameter is incorrect" The strange thing is the above sentence is not produced by an exception. i.e. the following code catch (Exception ex) { return ex.Message; } has never been executed. Quote There is no spoon. <<The Matrix>>
Administrators PlausiblyDamp Posted June 18, 2004 Administrators Posted June 18, 2004 If you change the server's exception handler to return something else does that really not change the contents of the label? i.e. catch (Exception ex) { return ex.Message + ' ' + "test"; } Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
michael_hk Posted June 18, 2004 Author Posted June 18, 2004 If you change the server's exception handler to return something else does that really not change the contents of the label? i.e. catch (Exception ex) { return ex.Message + ' ' + "test"; } God......the contents changed now......So I can firm it is an exception. :p But still don't know why it is an exception in Release mode, but not in Debug mode. Quote There is no spoon. <<The Matrix>>
Administrators PlausiblyDamp Posted June 24, 2004 Administrators Posted June 24, 2004 If you enable debug symbols on your release build and return ex.ToString() what line of code does it point to on the server code? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.