Home Dashboard Directory Help
Search

FtpWebRequest.GetRequestStream - (501) Syntax error in parameters or arguments. by ryonjensen


Status: 

Closed
 as Not Reproducible Help for as Not Reproducible


1
0
Sign in
to vote
Type: Bug
ID: 635079
Opened: 1/7/2011 8:19:09 AM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description

Running the following code in .NET 4.0 no longer works. Tested using LINQPad Versions 4.31(.NET 4) and 2.31 (.NET 3.5).

FtpWebRequest request = (FtpWebRequest)WebRequest.Create("[target]");
request.UseBinary = false;
request.KeepAlive = false;
request.Method = WebRequestMethods.Ftp.UploadFile;
request.Credentials = new NetworkCredential("[username]", "[password]");
request.GetRequestStream();

Doing on network trace on both (using Microsoft Network Monitor 3.4) reveals that the previous version of .NE is sending the FTP command "CWD /" after the "PWD" and before the "Type A" where as the .NET 4 version is not (everything else appears to be the same). Not sure why the difference, but the result is the "(501) Syntax error in parameters or arguments" thrown on the "GetRequestStream()".

If the usage is now different with the new version please update documentation.

Details
Sign in to post a comment.
Posted by Microsoft on 1/16/2011 at 8:13 PM
Hi, given that we have not heard back from you, we will go ahead and close this Connect Issue. If you get a chance to review and provide the information requested earlier, you can go ahead and reactivate this issue.(Click “Edit this item” button on the site and change the “Status” to “Active”)
Posted by Microsoft on 1/9/2011 at 9:45 PM
Thanks for reporting this issue. In order to fix the issue, we must first reproduce the issue in our labs. We are unable to reproduce the issue with the steps you provided.

We could get the result:

Unable to cast object of type 'System.Net.HttpWebRequest' to type 'System.Net.FtpWebRequest'

Please give us a demo project to demonstrate this issue so that we can conduct further research.

It would be greatly appreciated if you could provide us with that information as quickly as possible. If we do not hear back from you within 5 days, we will close this issue.

Thanks again for your efforts and we look forward to hearing from you.

Microsoft Visual Studio Connect Support Team

.
Posted by Microsoft on 1/7/2011 at 8:58 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.