Dev Center > Windows Forms Forums > ClickOnce and Setup & Deployment Projects > VS 2008 ClickOnce Publish to FTP: fails,

Discussion VS 2008 ClickOnce Publish to FTP: fails,

  • Friday, April 04, 2008 5:22 PM
     
     

    Greetings All,

    I have been using VS 2005 to publish ClickOnce applications to my FTP site with no trouble.  I specify non-passive, non-anonymous FTP, a dotted decimal address, username, and password.  Works great.

     

    However, when I try to do the exact same thing in VS 2008 (9.0.21022.8 RTM) (on Windows XP SP2, .NET 3.5), the publishing process fails, returning three error messages, as in the example below:

     

    *******

    Error 1 Failed to copy file 'C:\VS2008\BBProjects\DotNet35Checker\DotNet35Checker\bin\Debug\app.publish\DotNet35Checker.application' to 'ftp://82.165.148.19/Application Files/DotNet35Checker_1_0_0_5/DotNet35Checker.application'. Unable to add 'Application Files/DotNet35Checker_1_0_0_5/DotNet35Checker.application' to the Web site.  Could not find a Web server at '82.165.148.19' on port 21. Please check to make sure that the Web server name is valid and your proxy settings are set correctly. If you are sure that everything is correct, the Web server may be temporarily out of service.  1 1 DotNet35Checker

    *******

     

    The web server is definitely up and running; my colleagues and I can FTP to it using IE, WS-FTP, and FileZilla.  (I also made sure that IE's Use Passive FTP setting was unchecked.)  Curiously, the folders are created on the server, but files comprising the app (particularly .application, .deploy, and .manifest) are not delivered.  My IT guy says this is an indication that communication over the FTP Control channel is OK, but over the FTP Data channel is not.

     

    Whatever, I can't publish.  Is this a known bug in VS2008, or is there some configuration I have overlooked, or is there a workaround?  If it's a bug in VS2008, is there a timeframe for its being repaired?

    Thanks in advance,

    Bill Bell

     

All Replies

  • Friday, April 04, 2008 11:30 PM
    Moderator
     
     

     

    It's not a bug in VS2008.  We deploy our application using VS2008 with FTP successfully.

     

    Have you tried manually ftp'ing the files over and seeing if that will work?

     

    RobinS.

     

  • Monday, April 07, 2008 7:40 PM
     
     

     

    Hi Robin, thanks for writing back.

    Yes, I've been able to use another FTP program (WS-FTP) to send files from my publishing PC to the FTP site, thus confirming that the site is "up" and that my PC's interface to the web is fundamentally sound.  My colleague has also been able to use FileZilla to transfer files to the FTP site.

     

    I've noticed another peculiar difference between VS 2005 and VS 2008:

    VS 2005 publishes from a directory called C:\VS2007\AQWIP\bin\DebugUser\AQNet6.publish\AQNet6_1_0_0_116

     

    VS 2008 publishes from a directory called C:\VS2007\AQWIP\bin\DebugUser\app.publish\Application Files\AQNet6_1_0_0_116

     

    Although this difference doesn't particularly bother me, I mention it in case it might offer a clue as to the reason Visual Studio won't publish the app.  If the Publish feature works for you but not for me, I'm inclined to think I have a misconfiguration somewhere, but so far I've had no luck finding it.

     

    Regards,

    Bill

  • Monday, April 07, 2008 8:11 PM
    Moderator
     
     

    Yes, they changed the file structure in VS2008 for the deployed files.

     

    So the problem is that you can't get VS to push it directly to the ftp folder? You filled in the publish location as something like ftp://myservername/myfolder and then filled in the installation location with the corresponding http address, and the file transfer fails as noted in your first post? Just want to make sure I understand.

     

    Have you tried ftp'ing from Windows w/o using a 3rd party software? If you bring up a cmd window (if in Vista, you need to run it as an administrator), and type in ftp, try transferring the files *that* way and see if that works. That might be instructive.

     

    I have had a case where I can ftp to our server but can't push the files in VS. In my case, it's a network problem, and VS times out when pushing the files. I haven't tried ftp'ing them directly manually though, which might be illuminating.  If you do that, be sure to change the transfer to binary.

     

    What happens if you don't use passive mode?  Are you certain you're ftp'ing to the right folder/address?

     

    There is a product called Charles out there that lets you see all of the traffic going out and coming in on your computer. Maybe if you installed that, you could see the files being transferred.

     

    There's something funky going on, because we publish our production version using FTP and haven't had any problems with it. 

     

    RobinS.

    GoldMail.com

  • Tuesday, April 08, 2008 1:58 PM
     
     

    I just tried the command-line FTP utility to upload the project files, and it works rapidly and perfectly.  I noticed, however, that if I walk away from the FTP session for a couple of minutes and then come back to issue it some more commands, it tells me that the control connection timed out after 120 seconds, and I have to log in again.

     

    I've noticed that VS (both 2005 and 2008) seem to take an awful long time to publish projects, even small ones, whereas WS-FTP and command-line FTP run like scalded cats.  I'm not sure why VS is so slow at this (do you also find it slow?), but it might explain why it's failing to publish, if my FTP server "gets bored" waiting for VS to send it some files, and closes the connection.

     

    I've asked my LAN admin if he can increase the timeout period to see if that helps.  I'll let you know how it goes.

     

    BTW, I've tried it both with passive mode and without; it didn't work in either case, same errors.

     

    I'll try Charles too, that sounds interesting.

     

    Thanks very much for your feedback, this has been quite baffling.

     

    - Bill

  • Tuesday, April 08, 2008 10:07 PM
    Moderator
     
     

     

    You definitely have an FTP bandwidth problem. I sometimes have the same experience you are seeing. When I try to publish using FTP and it doesn't work, I ftp in manually, and it times out fairly quickly. I didn't see any difference between passive and non-passive either.

     

    Check out the Charles thing. If you can't find it, post back and I'll track it down.

     

    Good luck.

    RobinS.

    GoldMail.com

  • Friday, April 11, 2008 5:32 PM
     
     

    Hi Again,

    A discussion with my LAN administrator helped me to formulate a possible scenario to explain why my VS2008 is unable to publish ClickOnce apps to our FTP site:

     

    FTP servers can respond to requests to transfer data in either PASSIVE mode, or in PORT mode.  (Our FTP site is configured to respond to only to PORT mode requests.)

     

    When I use the command-line FTP client to send files to the server, I can observe in the DOS window that PORT mode is being used.  When I use IE, I presume that PORT mode is being used because I had previously unchecked the box in IE Tools/Internet Options/Advanced/Browsing: Use Passive FTP.  In both cases, the files are transferred properly.

     

    As mentioned, VS2008 fails to send files to our server, regardless of the state of the "Connect Using Passive Mode" box presented on VS' dialog box (the one that appears right after the Publish button is clicked).

     

    RobinS., you reported that publishing worked OK for you.  Is your FTP site able to respond to Passive-mode requests?  If so, then it might not matter whether or not you checked "Connect Using Passive Mode" in VS2008.  So there could be a bug in VS2008, to wit, that checkbox doesn't work, in the sense that it will always use Passive mode.  If your server is configured to respond to that, great, it works.  If not, then there is nothing you can do (except wait for a service pack:-) ).

     

    What do you think?

     

    Regards,

    Bill

  • Friday, April 11, 2008 7:39 PM
     
     

    My LAN admin temporarily opened all ports on our FTP server instead of only ports 20 and 21, and finally VS2008 was able to publish my ClickOnce app.

     

    Not wanting to leave our system in such a vulnerable state, he reenabled IP Security (ipsec), and wrote a rule for the server that allows FTP traffic only from us.

     

    So I'm now FMC (fully mission-capable), but it does seem established that VS2008's Publish feature isn't honoring the state of the "Connect Using Passive Mode" checkbox.

     

    Regards,
    Bill

  • Saturday, April 12, 2008 4:21 AM
    Moderator
     
     

     

    Wow, it's great the you guys figured that out and got it working. I have no idea what our servers are configured for. We also ftp our public deployment to a content delivery network, and have no problems with that either.

     

    My guess that in both cases, they also have a rule for the server that allows FTP traffic to our site(s) only for us. I don't know if it is passive or not. I think for our server it does make a difference, because I was mucking with it one day and the network engineer was looking over my shoulder, and he said "check passive" because it wasn't working, and after I did that, it did work. I don't know about the CDN though.

     

    Congratulations; bask in the glory of a difficult problem fixed. :-)

     

    RobinS.

    GoldMaIl.com

     

  • Friday, May 30, 2008 7:01 PM
     
     

    I was able to publish my C# application with Visual Studion 2005 to a ftp/http site, but can't with Visual Studio 2008. It has nothing to do with ftp/http security. For some reason, the publish process with Visual Studio 2008 insists on creating a subdirectory with a space in the name "Application Files". This won't work with FTP. I have searched my project files and can't find where the problem is. If I create a new application with Visual Studio 2008, it  publishes fine.

     

    Where is this going wrong - why does it insist on using the directory "Application Files" and how can I fix this (without resorting to create a new project file)

     

    Mike Bergamo

     

  • Friday, May 30, 2008 9:24 PM
    Moderator
     
     

    Yes, Visual Studio 2008 uses a different folder structure than 2005 for the deployment files on the server. It basically puts the different version in a folder called Application Files instead of leaving them in your root directory. It is much cleaner and easier to deal with from a maintenance standpoint.

     

    We use FTP to deploy our application and have no problem with this. What you want to check is the security on the folder on the web server, to make sure the account you are using to ftp the files has the security level to create directories. If not, have them create the "Application Files" folder for you.

     

    RobinS.

    GoldMail.com

  • Friday, June 06, 2008 7:36 PM
     
     

    It has nothing to do with security. I am using Yahoo hosting. If I attempt to create a directory like "Application Files", it flags that as a bad directory name. Man, the tool was useful, not it is not worth using. With the whole security issues ClickOnce imposes, the resulting application can do just about nothing (Don't you just love Vista). I can't even take the shortcut and set the "run as administrator". Microsoft gave us Click Once and Mage, but took away anything useful.

     

     

     

  • Saturday, June 07, 2008 9:19 PM
     
     

    The issue looks like in the creation of "Application Files" on the ftp server. VS 2005 did not try to create this directory on the ftp server, only VS 2008 does. Not sure how to get around this... :-(

  • Sunday, June 08, 2008 4:24 PM
    Moderator
     
     

    "I am using Yahoo hosting".  That is your problem, it's not ClickOnce. If nobody could deploy their applications with ClickOnce using VS2008, which puts the packages in the "Application Files" folder, then nobody would use it, which doesn't seem to be the case, judging by the number of questions in this forum about it.

     

    So what OS is the Yahoo server running, and why won't they let you create a folder with that name? If someone creates the "Application Files" folder under the root folder for your deployment, then does it work? You need to talk to Yahoo about this.

     

    I don't know what MSFT "took away". Aside from ClickOnce, you can still create setup & deployment packages with any version of Visual Studio except Express.

     

    RobinS.

    GoldMail.com

  • Sunday, June 08, 2008 4:25 PM
    Moderator
     
     
     shetty_pradeep wrote:

    The issue looks like in the creation of "Application Files" on the ftp server. VS 2005 did not try to create this directory on the ftp server, only VS 2008 does. Not sure how to get around this... :-(

     

    There's no way to get around this. Talk to your web server people. What kind of server doesn't let you create a folder named "Application Files"?

     

    RobinS.

    GoldMail.com

  • Sunday, June 08, 2008 9:49 PM
     
     

    The type of ftp server that serves http files (which will not work with spaces in names). It is not very useful to create a tool like mage and not allow things like "Application Files" to be changed to something without spaces. Sure I use Yahoo which has some restrictions on names. As you can see Microsoft can't cover all required cases by not allowing a simple property setting.

     

    As for the other stuff taken away. I really need the deployed application to be able to be security raised, so I can do some things like read/write the local machine part of the registry. I also need the application to start/stop a service. I have tried to work the the click-once security settings, but deploying anything but "Full-Trust" results in an installer that crashes when you try to run it (this is Vista).

     

     

     

  • Tuesday, June 17, 2008 6:05 AM
    Moderator
     
     

    If you want to deploy an application with privileges, use a Setup & Deployment Package.

     

    ClickOnce is designed to work for applications that do not require raised privileges, which is one reason it is installed in the user's profile -- it requires no privileges to install a ClickOnce application. It is designed that way purposefully, and it fulfills its intention. If you want something different, use a different tool.

     

    RobinS.

    GoldMail.com