Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

There is no spoon. <<The Matrix>>
Posted
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;
}
}

There is no spoon. <<The Matrix>>
Posted
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.

There is no spoon. <<The Matrix>>
Posted
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.

There is no spoon. <<The Matrix>>

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...