Problem renaming file on FTP server using FtpWebRequest in .NET Framework 4.0 VS2010 only! - by atconway

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 621450 Comments
Status Closed Workarounds
Type Bug Repros 7
Opened 11/12/2010 11:06:18 AM
Access Restriction Public


The simple code to 'rename' a file on a FTP server using the FtpWebRequest class in .NET Framework 4.0 is not preforming as intended.  In VS.NET 2010 .NET Framework 4.0 project I always get back when attempting to rename a file on a FTP server: "The remote server returned an error: (550) File unavailable (e.g., file not found, no access)." The identical code when run in VS.NET 2008 .NET Framework 3.5 works perfectly.

The MSDN does not document needing to change how to code using the FtpWebRequest class when issuing a 'WebRequestMethods.Ftp.Rename' method. However looking at a network trace produced using system diagnostics configurations shows that the issuing 'RFNR' FTP command provides the filename preceded with a 'slash' (/) as opposed to solely just the filename. This behavior is causing an unavoidable   "The remote server returned an error: (550) File unavailable (e.g., file not found, no access)." error. This is not a permissions issue as I mentioned the code works perfectly in VS.NET 2008.
Sign in to post a comment.
Posted by Deon [MSFT] on 4/29/2014 at 12:17 PM
Thank you for reporting this issue. This issue has been fixed in Visual Studio 2013. You can install a trial version of Visual Studio 2013 with the fix from:
Posted by Andrew Burrow on 9/5/2013 at 5:47 AM
Okay thanks for the reply. I'm posting this as it may help someone else in the same situation. I tried the workaround but found it didn't work for me. In the examples I see that most people use RenameTo as a way to move the file also, I was simply renaming the file in it's current location. For me all I had to do was change the way I was setting System.Net.FtpWebRequest.RenameTo by simply ommiting the full path and just specifying newfilename.extension, this worked for me, as apposed to /somefolder/newfilename.extension
Posted by Chris [MSFT] on 9/4/2013 at 11:10 AM
The issue was fixed in .NET 4.5. Let us know if you have additional issues here.
Posted by Andrew Burrow on 9/4/2013 at 1:45 AM
Please can someone tell the community when this will be fixed. I also have this issue having upgraded to .Net 4 and now have to code around it.
Posted by Nirav Kanakhara on 3/7/2013 at 3:54 AM
Its not bug, its change in format of input that user has to submit for property ftpwebrequest.RenameTo.
If you can see in vs2008 we are providing the absolute url to rename directory.

while in vs2010 you must have to provide relative url.

i.e. ftpwebrequest.RenameTo = "../" + toFolder + "/" + filename;

Its working...:)
Posted by BushersNeto on 5/17/2011 at 4:06 PM
Is no known workaround for this problem


Se conoce alguna solucion alternativo que no sea volver al Framework 3.5

Thanks / Gracias.
Posted by Chris [MSFT] on 1/7/2011 at 9:18 AM
We are not currently aware of a workaround. To request a patch for .NET 4.0 please contact support directly (
Posted by ryonjensen on 1/6/2011 at 6:14 PM
Looks like this has been resolved ... is there a current work around?
Posted by ocagnato on 12/21/2010 at 7:56 AM
I am facing serious problems about this annoying behavior. When will be resolved?
Posted by steveberkovitz on 12/21/2010 at 7:48 AM
Will this be resolved in SP1?
Posted by Chris [MSFT] on 12/13/2010 at 3:46 PM
Thank you for reporting this issue. We will plan to address this in a future release. If you require further assistance please contact support directly (
Posted by Microsoft on 11/12/2010 at 11:22 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(