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.