FTPWebRequest .NET 3.5 vs 4

2019-07-13 08:01发布

I have an application that does an FTP connection to an IBM mainframe and all has been working fine. I then recompiled against .NET 4 and the mainframe no longer accepts the file giving me an error message stating either the file doesn't exist, or I don't have permission for it.

This is what I use to send the file:

Ftp = (FtpWebRequest)FtpWebRequest.Create(FtpAddress + "%2F'" + "EM.MOM.FIMSDATA" + ".AA." + "RR(+1)" + "'");

Has Microsoft changed anything between .NET 3.5 and 4 because this points to a framework change?

1条回答
我只想做你的唯一
2楼-- · 2019-07-13 08:28

I found this on Microsoft.

The cause of this issue is due to a behavior change in the System.Net.FtpWebRequest class in .Net Framework 4. There has been a change made to the System.Net.FtpWebRequest class from .Net Framework 3.5 to .Net Framework 4 to streamline the use of the CWD protocol commands. The new implementation of the System.Net.FtpWebRequest class prevents the send of extra CWD commands before issuing the actual command which the user requested and instead directly sends the requested command. For fully RFC compliant FTP servers, this should not be an issue, however for non-fully RFC compliant servers, you will see these types of errors.

Solution is on: http://support.microsoft.com/kb/2134299

查看更多
登录 后发表回答