none
Clickonce deploy problem with IIS 7

    Question

  • I have a "ClickOnce" application that deploys without any problems from a Win2K3 server and IIS 6.  

    But the same application fails to be deployed from a Windows Server 2008/IIS7, I receive a 404 file not found (on a .config file and not on one of the manifest files) during the installation on a client machine.  

    In the IIS the mime types .application, .deploy and .manifest are declared correctly, the virtual folder has read & script only execution permissions and it uses the classic .NET AppPool.  

    What I’m missing?

    Tuesday, May 05, 2009 9:11 AM

Answers

  • To solve this issue, there are following two solutions:
    1. Enable 'Use ".deploy" file extension' when deploying your ClickOnce application.
    2. Change the config file %windir%\System32\inetsrv\config\applicationHost.config according to this post http://support.microsoft.com/kb/942045. In IIS7, "allowUnlisted" is "true" by default, so you maybe only need to change it like below:
                 <requestFiltering>
                    <fileExtensions allowUnlisted="true" applyToWebDAV="true">
                        <add fileExtension=".config" allowed="false" />     //-----change to: <add fileExtension=".config" allowed="true" />  is OK.
                        ...
                    </fileExtensions>
                </requestFiltering>

    Hope it's helpful!

    Corin Wei

    Just do it
    Monday, November 30, 2009 8:17 AM

All replies

  • Hi Andresd367621,

    Can you visit other web site on the server? Did you publish to that virtual folder or copy the deployment file to the folder?

    Sincerely,
    Kira Qian


    Please mark the replies as answers if they help and unmark if they don't.
    Thursday, May 07, 2009 6:20 AM
  • If you link directly to the application file, do you still get the 404 error? I don't know if you are linking to a publish.htm file, or the application or the setup.exe or what.

    Can you check the permissions on the folder and make sure the user can get to it (although I think if this was the problem, it would say 'user not authorized' or something like that).

    You might also try to install some kind of network tracker like Charles and see what is going on when the user brings up the link in the browser, to see where he's actually going. Maybe there's a problem with the setup of the folder on the web server or something like that.

    For example, I have folders I deploy to using FTP on our servers, and there is an alias set up in IIS to point at that folder.

    RobinDotNet


    Click here to visit my ClickOnce blog!
    Thursday, May 07, 2009 6:28 AM
  • Please make sure that your web.config contains the following:
    <system.webServer>
        <security>
          <requestFiltering>
            <fileExtensions allowUnlisted="true" applyToWebDAV="true" />
          </requestFiltering>
        </security>
      </system.webServer>

    under configuration. IIS7 by default filters out the files with .config extension

    Good luck!
    Wednesday, September 30, 2009 9:35 PM
  • I have IIS7 installed on two of my computers, and haven't had any problems.

    Do you have the "add the .deploy extension" checkbox checked in the publish properties? You should, because most people have some kind if virus protection that keeps you from downloading dll and exe files.

    RobinDotNet


    Click here to visit my ClickOnce blog!
    Microsoft MVP
    Friday, October 02, 2009 8:30 AM
  • It depends of what types of files get distributed through ClickOnce. The original post mentioned .config file not deploying. We had exactly the same issue with IIS7. The culprit was the Request Filtering feature of the IIS7 which by default blocks the access to *.config files. Our resolution was to modify our web.config to remove this restriction for our virtual directory.
    Friday, October 02, 2009 4:26 PM
  • If you have the checkbox for "use .deploy file extension" checked, then it appends .deploy to all of the file names, and it doesn't come across as a .config file (which is the reason it does this). ClickOnce removes the file extension when putting it on the user's computer. I've just checked mine, and every file under application_files in the app.publish has .deploy appended to the file name.

    Did you have that checkbox checked?

    RobinDotNet
    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev
    Friday, October 02, 2009 6:59 PM
  • To solve this issue, there are following two solutions:
    1. Enable 'Use ".deploy" file extension' when deploying your ClickOnce application.
    2. Change the config file %windir%\System32\inetsrv\config\applicationHost.config according to this post http://support.microsoft.com/kb/942045. In IIS7, "allowUnlisted" is "true" by default, so you maybe only need to change it like below:
                 <requestFiltering>
                    <fileExtensions allowUnlisted="true" applyToWebDAV="true">
                        <add fileExtension=".config" allowed="false" />     //-----change to: <add fileExtension=".config" allowed="true" />  is OK.
                        ...
                    </fileExtensions>
                </requestFiltering>

    Hope it's helpful!

    Corin Wei

    Just do it
    Monday, November 30, 2009 8:17 AM
  • Thanks buddy.. its really worked for me....
    ESS TVM
    Tuesday, June 08, 2010 9:20 AM
  • Thanks for sharing this info! The .deploy option worked perfectly for me.

    For people seeking this option, it's located in Visual Studio under your project properties on the Publish tab click Options. In the Publish Options dialog box that pops up, navigate to the Deployment section using the left column. Put a checkmark in front of Use ".deploy" file extension. Click OK to close the dialog box and click Publish Now to publish a new version of your application using .deploy files instead of .config files.

    Wednesday, March 16, 2011 12:23 PM