none
Why does the ClickOnce 'Install' button generate an xml page instead of starting download? RRS feed

  • Question

  • Hello,

    I just published my application for ClickOnce deployment to my web site.  When I click on the Install button on the publish\publish.htm page on my website, the browser returns the contents of an xml file and does not start the download.  Does anyone know what might be causing this?

    Any help or suggestions would be greatly appreciated.

    Thanks! Jason

    Sunday, June 4, 2006 12:19 AM

All replies

  • I have the exact same problem, on my pc running vista it works perfectly but on xp using IE 6 it doesn't work and i had it test on a few other people's computer they have the same problem they get the xml also the webhost have the mime types set and the dfshim.dll is also working as it should so it's strange, i hope somehow there will be a solution to this.
    Saturday, June 17, 2006 9:44 PM
  • If you have not installed .NET 2.0 on the web server, you may need to manually configure the MIME type.  In IIS Manager, open the properties for the Virtual Directory that contains your .application file.  On the HTTP Headers tab, click the "MIME Types..." button.  Click the "New..." button to register a new MIME type.  In the Extension textbox, type ".application" (no quotes, obviously).  In the MIME Type textbox, type "application/x-ms-application".  Click OK to close all of the dialogs, and try running the ClickOnce application again.  You may need to empty your browser's cache to see a difference depending on your configured caching settings.

    Hope that helps!
    Tuesday, June 20, 2006 1:42 PM
  • DaCodeBoy,

    Another possible cause of the problem may be that the server is not configured to associate the .application extension with the content type "application/x-ms-application".  I had the problem that you described and a call to my web host's tech support resolved the problem.  They made a change to the server and within 2 minutes all was well.  Best of luck.

    Wednesday, June 21, 2006 7:01 PM
  • The mime types are all set as they should be but the problem still exist on IE6 however with IE7 beta 2 we have no problems
    Thursday, June 22, 2006 5:41 PM
  • Thank you very much for the suggestions.  The problem still exists despite Mime settings being correct (same as CyberOps).
    Sunday, June 25, 2006 2:24 AM
  • Jason,

    Have you tried this?

    Another possible cause of the problem may be that the server is not configured to associate the .application extension with the content type "application/x-ms-application".  I had the problem that you described and a call to my web host's tech support resolved the problem.  They made a change to the server and within 2 minutes all was well.  Best of luck.

    Sunday, June 25, 2006 2:42 AM
  • already tried that to everything is set and all, works great with IE7 but still the same problem with IE6 users. So the conclusion is that there is a problem with it not working in IE6, someone said it has something to do with the Active XML ?? i hope someone can come with a answer
    Wednesday, June 28, 2006 8:12 PM
  • CyberOps,

    My ClickOnce applications work great!  I use IE 6.0.  Perhaps if you would publish the URL where where your application is loaded, orhers could look at the the page and make further suggestions.

    Wednesday, June 28, 2006 8:46 PM
  • I have the same problem with ClickOnce application and IE6, the browser recognize it
    as XML text file, the funny thing is that it works fine on FireFox with appropriate extension.

    Any way I have digged the web after the solution but still unsuccessfully.
    There is an article about MIME sniffing control, I have followed that instruction but unsuccessfuly.

    http://technet2.microsoft.com/WindowsServer/en/Library/e5a730ee-a68b-4789-8419-4de4c3c7950d1033.mspx?mfr=true


    If anybody can help me I will appreciate.

    Thursday, June 29, 2006 12:18 PM
  • We are experiencing the exact same problem.  It doesn't work under IE 6 (just displays XML), works with IE 7 Beta.  Just upgraded a pc that was using IE 6 to IE 7 and now the install works correctly.
    Monday, July 3, 2006 9:27 AM
  • For now I have found that it happens but not on all IEs 6, on part of them it do works well,
    I am still loking what the exact reason for that behaviour.
    Monday, July 3, 2006 10:00 AM
  • I also still have the same problems and have not been able to figure out what the problem exactly is, indeed IE7 works great but IE6 doesn't i hope somone can come up with a solution soon.
    Tuesday, July 4, 2006 9:57 AM
  • On msdn2, it says that you should associate it with "application/deployment". When I do this, I still get xml, but when I do Properties, it says that it is a "Deployment Manifest". Somehow IE6 knows what it is, but just doesn't want to do anything with it.

     

     

    Wednesday, July 5, 2006 4:26 AM
  • I too am experiencing this frustrating ClickOnce behavior when installing from IE 6.0.

    We tried adding the mime type application/x-ms-application to our apache server but this had no effect.

    This is our current solution which I call "ClickOnce and Fudge "

    • Publish your application as normal
    • Edit your deploy file (i.e deploy.htm)

      Change the following javascript line:

         directLink = "<your app>.application"
    to
         directLink = "<your app>.application.php"

    • Copy the file <your app>.application to <your app>.application.php   (note you still need the original  )
    • Edit <your app>.application.php (inserting the following at the very top)

         <?php header("Content-Type: application/x-ms-application"); ?>

    This works around the problem!

    Deploy.htm calls '<app name>.application.php' which runs the xml instead of printing it. This in turn runs the original '<app name>.application file' which is referenced inside the <deploymentProvider> tag. I tried renaming this to '<app name>.application.php' but then the installation process complains about the manifest being invalid.

    I did try what Todd recommends in the following post...and it does work and explains the problem, but it is still a manual step for a user to do. "Click and Fudge " works for us, allowing (eventually) one-click installation to IE 6.0 the way you would expect it to work.

    Incidentally,  I have found IE 6 will install your ClickOnce project without any any fudging around if you invoke the installer not from the web but from a file path (e.g. \\server\myapplication)

    I have only been using Visual Studio.NET for 5 days, so I would appreciate it if anyone knows a better solution.

    Please, please someone from Microsoft fix this IE 6.0 ClickOnce install issue

    Regards,
    Anthony

     

    Friday, July 7, 2006 1:42 PM
  • This is due to a setting in IE that gets set when you install SP2.  Go to Internet Options > Security > Select Internet Zone > Click Custom Level button.  About 3/4 of the way down there is an option called "Open Files based on content, not file extension", which is Enabled.  Disable this option and you will be able to launch the ClickOnce app.
    Friday, July 7, 2006 5:58 PM
  • If this fixed the problem, then I'm sorry to say that you did not have Apache set up to serve the correct MIME types.  I'm guessing that most people in this thread are in the same boat: they believe (strongly) that they have configured their web server correctly, but in reality they have not. 

    Download an HTTP Sniffer, such as Microsoft Fiddler (www.fiddlertool.com), and attempt to run the .application file.  Look at the HTTP Headers in the Server Response.  If the Content-Type is anything except  "application/x-ms-application", you will have problems getting applications to run.  Please modify the web server configuration until you get the Content-Type in Fiddler to say "application/x-ms-application".

    Why does it work correctly in IE7?  My guess is that Microsoft has added code to recognize the .application extension as a ClickOnce application.  However, you cannot and should not depend on this.  Web servers are designed to indicate file type by the Content-Type header, not by file extension.
    Tuesday, August 1, 2006 1:48 PM
  • If this fixed the problem, then I'm sorry to say that you did not have Apache set up to serve the correct MIME types.  I'm guessing that most people in this thread are in the same boat: they believe (strongly) that they have configured their web server correctly, but in reality they have not. 

    Download an HTTP Sniffer, such as Microsoft Fiddler (www.fiddlertool.com), and attempt to run the .application file.  Look at the HTTP Headers in the Server Response.  If the Content-Type is anything except  "application/x-ms-application", you will have problems getting applications to run.  Please modify the web server configuration until you get the Content-Type in Fiddler to say "application/x-ms-application".

    Why does it work correctly in IE7?  My guess is that Microsoft has added code to recognize the .application extension as a ClickOnce application.  However, you cannot and should not depend on this.  Web servers are designed to indicate file type by the Content-Type header, not by file extension.
    Tuesday, August 1, 2006 1:50 PM
  • <sigh> Sorry about the double-post.  I received a forum error when posting it, and then I received a forum error when trying to delete the duplicate.
    Tuesday, August 1, 2006 1:54 PM
  • Should not rely on client side registration for file type?

    Sounds sensible, however without a handler on the client for the mime type it will not be any use. Therefore, it seems that the .application registered as "Application Reference" on the client and with the "Application Deployment Support Library" as the handler is more effecetive than having to flag mime\type at the server.

    With the exception that if you wanted to deployed your application manifest in some way other than *.application file you would be not be able to.

    Of course both approaches work, but the server side mime type setting should not be neccessary for simplfied deployment.

    Saturday, September 2, 2006 7:03 AM
  • Hi Anthony,

    This worked great for me, thanks!

    It should be noted, that on some servers running php you may need to put some extra work in though.  If the server has shortcutting enabled, the "<?" and ">?" from the xml declaration will be interpreted as the start and close tags to a PHP script block, and then the PHP fails because the xml declaration betweenis obviously not valid PHP syntax.

    This is esy to work around, just enclose those tokens in a script block, and echo them out:
    <?php header("Content-Type: application/x-ms-application");?>
    <?php echo "<?xml"; ?> version="1.0" encoding="utf-8" <?php echo "?>"; ?>

    Also, another issue I got was an error reading: "Warning: Cannot modify header information - headers already sent".

    This error can be caused if there are any characters before <?php header("Content-Type: application/x-ms-application");?>.  This characters automagically appeared in my PHP file somewhere between me writing it in notepad, and uploading it to my web server.  Editing the files in a binary editor, or perhaps in your web servers control panel if you have an interface to do so, takes care of that no problem.

    Thanks for the post, saved my life!


    Thursday, August 2, 2007 2:25 PM
  • You're very welcome zfrenzel.

     

    ..thanks also for pointing out the problem with the php short tags. 

     

    regards,

    Anthony

     

     

     

     

     

     

    Friday, August 3, 2007 1:12 PM
  • I have the same problem, IE7 works fine, IE6 (version: 6.0.2900.2180.xpsp_sp2_rtm.040803-2158) not works. Two years passed, are there any workarounds?

    Thursday, October 30, 2008 9:45 AM
  • per Troubleshooting Specific Errors in ClickOnce Deployments, register the content types on the server and client.  if that doesn't work, try reinstalling .NET Framework 2.0 on the client.

     

    When you try to locate an .application file, nothing occurs, or XML renders in Internet Explorer, or you receive a Run or Save As dialog box

    This error is likely caused by content types (also known as MIME types) not being registered correctly on the server or client.

    First, make sure that the server is configured to associate the .application extension with content type "application/x-ms-application".

    If the server is configured correctly, ensure that the .NET Framework 2.0 is installed on your computer. If the .NET Framework 2.0 is installed, and you are still seeing this problem, try uninstalling and reinstalling the .NET Framework 2.0 to re-register the content type on the client.

     

    m.
    Thursday, October 30, 2008 9:32 PM
    Moderator
  • I am sure the MIME are well configured on the server, because most of the clients are working well, all IE7/8 browsers and even some IE6 !

    also, I have checked the associate of the .application extension in the client, the "open" command is "
    rundll32.exe dfshim.dll,ShOpenVerbShortcut %1", same as other clients. When I type the command in Prompt window as following:
    c:\rundll32.exe dfshim.dll,ShOpenVerbShortcut https://mySite.com/myApp/xxxx.application
    It worked!

    I think it should be some bugs in this version IE6. I just want to know what is the exactly requirement of the client OS and  browsers, I have to notify all clients how to prepare their OS. I remember the MSDN documents said ClickOnce requires IE5.01 or later, but the fact is not.

    Thank you!

    Friday, October 31, 2008 4:00 AM