none
ClickOnce - Application Improperly Formatted Error RRS feed

  • Question

  • I have successfully published several VB 2008 Express applications to my website.  When I attempt to run them, the publish webpage opens and displays the following:

     

    The following prerequisites are required:

     

    ·                            Windows Installer 3.1

    ·                            .NET Framework 3.5

    If these components are already installed, you can launch the application now. Otherwise, click the button below to install the prerequisites and run the application.

     

    Clicking the launch hyperlink opens the application and it runs, clicking the big RUN button below the text produces an error that says, "Cannot continue. The application is improperly formatted. Contact the application vendor for assistance."  My ClickOnce deployment uses the “Download prerequisites from the vendor’s website.”  The prerequisites for this application are: “.NET Framework 3.5,” and “Windows Installer 3.1.”  As I understand my MSDN education, this should work.

     

    Previously, I published VB 2005 Express applications to my website with out this problem. When users open the application's publiish webpage there was only a RUN button, and it worked.  I'd like my ClickOnce applications to operate like it did on VB 2005.

     

    Based on a suggestion from the VB Express forum, I modified files in the .NET 3.5 Framework, when that didn't work I decided to uninstall and reinstall Visual Studio all the way back to the .NET Framework.  After everything was reinstalled and working the ClickOnce problem was still present. 

     

    Today, I visited a user who could not RUN this application.  When he attempted to RUN the application he got the same publish webpage that I did.  He clicked the RUN button and got the same message that I got.  When he clicked the launch link he got an ugly error message.  His system only had .NET Framework 2.0.  The RUN button did not install the prerequisites as it is suppose to do.  After I installed .NET Framework 3.5, and clicked the launch link the application successfully ran.

     

    For some reason my ClickOnce publishing is not working as it should. In addition to uninstalling and reinstalling all of VS, I have run VB Express as an Administrator, published a super simple, one button-one label, HelloWorld application, read and reread MSDN's ClickOnce information, and have not been able to fix this problem.  For complete disclosure you should know that my OS is Vista; the successful VB 2005 deployments were under the XP operating system.  I don't know where else to turn; you are my last hope.

     

    Wednesday, February 20, 2008 3:02 PM

Answers

  • GrandpaB & Nilkanth,

     

    Microsoft Support did resolve my problem.  Here's what it was.

     

    My app is called SpotLight.  In Solution Explorer, if you double click My Project, and then click the References Tab, I had a Reference to SpotLight.  How it got there I'm not sure.  I did not put it there, but it apprently causes some kind of circular reference which caused Click Once to fail and my App to no longer run after a Publish.

     

    To fix my problem I simply clicked on the SpotLight reference and deleted it.  Problem solved.

     

    I'm wondering if I may have created this reference by using "Add existing item".  When I need to create a new form or report that is similar to an existing form or report, Visual Studio does not let you copy and paste a form to create a new form which can be modified.  Thus to save time, I'll make a copy of my Project, rename a form in the copy, and then "Add existing item" to import the form from the copied project.  This saves a lot of time and seems to work, but I wonder if I created a reference to SpotLight in the process.  I'll have to do some testing to see if I can re-create the reference.

     

    Anyone have a better way of duplicating a form or report so you don't have to start from scratch to create a similar form?

     

    Joe A

    Thursday, March 6, 2008 8:02 PM
  • Problem Solved!!!

     

    I talked to the tech support people at the ISP that is hosting my wedbsite and they moved my website to a server that is running ASP.NET 3.5.  This seems to have solved the problem.  I don't know how this solved the problem, but for now all is well.

    Tuesday, March 18, 2008 2:56 PM

All replies

  • In my deployments, when the RUN button is clicked I continue to get the error message “Cannot continue. The application is improperly formatted.”  Any insight into this problem would be greatly appreciated.

     

    I found a ClickOnce blog posted by Shahar Gvirtz (http://weblogs.asp.net/shahar/archive/2008/01/29/how-to-use-clickonce-to-deploy-your-applications.aspx) that describes the deployment process. The blog contained some screen shots and they match the views that I am experiencing. 

     

    I have a comment about the deployment window.  My users, in general, do not know if they have the required prerequisites; only the techie folks know.  I would hope that the RUN button would first check for the prerequisites.  If they needed to be downloaded, ClickOnce should open a message box giving the user the option to accept or cancel the download.  After the prerequisite issues are resolved ClickOnce should then proceed with the application download.  If ClickOnce worked this way the prerequisite information on the deployment webpage would be unnecessary; the prerequisite information could be presented in the message box if required.

    Saturday, February 23, 2008 4:01 PM
  • I'm having the same problem.

     

    In the past, my Visual Studio 2005 Click Once apps all installed fine.  Now with Visual Studio 2008 my apps fail to install.  the click once web page installed .net Framework 3.5 & Microsoft Visual Studio 2008 Report Viewer properly and automatically, but the app itself will not install or run... giving the same error

     

    "Cannot Continue.  The application is imporoperly formatted.  Contact the application vendor for assistance."

     

    Any Help would be appeciated.

     

    Joe A

    Monday, February 25, 2008 2:32 PM
  • Joe,

     

    Thanks for your post.  I'm sorry that you are having difficulty, but it's nice to know that I'm not the only one with this problem.

     

    Monday, February 25, 2008 7:09 PM
  • Joe,

     

    It appears that you and I are the only two that are having this problem.  We have not gotten anyone else who has experienced this problem, or has a solution.  It must be a tough one or you and I are a pair of klutzes.

    Thursday, February 28, 2008 4:39 AM
  • GranpaB

     

    I've put in a paid support call to Microsoft.  They said I'm entitled to 2 free incidents so you may want to try this also.  I've had two 3 hours support calls so far and no resolution yet, but they are working on it.  I expect another call today.

     

    By the way, I have copies of my project both before and after I did the Publish.  Not only are the client machines unable to install my App, but my App will no longer run in Visual Studio 2008 after the publish.  After a Publish, if I press F5 to run the App in VS2008 I get an "ArgumentNullException was unhandled.  Value can not be Null.  Parameter Name: activationcontext"

     

    This parameter is not one that I created.  The exception happens before the startup form starts to load, as proved using message boxes.

     

    I'll let you know how I make out.

     

    Joe A

    Thursday, February 28, 2008 3:42 PM
  • Joe,

     

    Thanks for the update.  I am to the state of making a support call to Microsoft too.  Do you have a case number or some way that I could refer to your problem?  If the Microsoft's techie guru giants could compare our two problems perhaps it would spark a solution.

     

    In my case client machines can install the application if they click the Launch link, and if they have all the prerequisites installed.  If they click the RUN button they get the "The application is improperly formatted" error message. They get this message whether the prerequisites are loaded or not.

    Thursday, February 28, 2008 7:04 PM
  • Joe,

     

    If you're interested in attempting to coordinate our Microsoft Support calls you can contact me via email. I just created an email address for for this specific purpose in my user profile. 

     

    Friday, February 29, 2008 2:17 AM
  • GrandpaB,

     

    I think there are enough differences in our cases that coordination would not be beneficial.

     

    The 3rd MS technician was not able to resolve my case so he has "escalated" my case up a level.  It's not getting resolved easily.  My clients are desparately awaiting my App.  I may have to go the normal msi route for now and replace it later with a click once copy when Microsoft gets this resolved.

     

    Joe

    Friday, February 29, 2008 1:48 PM
  • Joe,

     

    I understand, best of luck.

    Friday, February 29, 2008 3:08 PM
  •  

    Hi GrampaB,

             I am also experiencing same issue as yours. Are you going to put the resolution on this blog if you receive from microsoft? Did you receive any positive response from microsoft on this issue so far?

     

    Thanks,

     

    Nilkanth Desai

     

    Tuesday, March 4, 2008 12:17 AM
  • Nilkanth,

     

    Yes, I will post the results of my discussions with Microsoft as soon as they occur.  Unfortunately, I have been diverted by other projects, but hope to return to this problem by Wednesday.

    Tuesday, March 4, 2008 12:52 AM
  • Nilkanth,

     

    I have created a Support Issue with Microsoft on my case.  It's been a week now with 2 long phone cons & live meetintgs.  No resultion yet.  They are escalating my case up the ladder.  I'll post the resolution when I get it.

     

    Joe A

    Tuesday, March 4, 2008 2:11 PM
  • GrandpaB & Nilkanth,

     

    Microsoft Support did resolve my problem.  Here's what it was.

     

    My app is called SpotLight.  In Solution Explorer, if you double click My Project, and then click the References Tab, I had a Reference to SpotLight.  How it got there I'm not sure.  I did not put it there, but it apprently causes some kind of circular reference which caused Click Once to fail and my App to no longer run after a Publish.

     

    To fix my problem I simply clicked on the SpotLight reference and deleted it.  Problem solved.

     

    I'm wondering if I may have created this reference by using "Add existing item".  When I need to create a new form or report that is similar to an existing form or report, Visual Studio does not let you copy and paste a form to create a new form which can be modified.  Thus to save time, I'll make a copy of my Project, rename a form in the copy, and then "Add existing item" to import the form from the copied project.  This saves a lot of time and seems to work, but I wonder if I created a reference to SpotLight in the process.  I'll have to do some testing to see if I can re-create the reference.

     

    Anyone have a better way of duplicating a form or report so you don't have to start from scratch to create a similar form?

     

    Joe A

    Thursday, March 6, 2008 8:02 PM
  • Joe,

     

    Thanks for the update; I'm glad that you problem has been resolved.  After reading about your fix, I checked my applications and I do not have a reference to my application in the References tab. Our problems are similar, but as you concluded, they are different.  I began my paid support issue via email last night. I've yet to receive a response.

     

    Bernie

    Thursday, March 6, 2008 8:47 PM
  • Hi Joe,

          I check for the similar refference in my project. It seems I also need to get a ticket base support from Microsoft. Any way thanks for your updates.  Bemie  If you find any result please update this blog.

     

    Nilkanth

    Saturday, March 8, 2008 12:02 AM
  • My "Application Improperly Formatted" error persists.  I am in the middle of a paid support session with a Microsoft technician.  He had me install IIS 7 on my system.  I can now successfully deploy my applications to the localhost, but I am still unable to deploy them to the ISP that hosts my website.  I checked with the ISP technical help and learned that the server that hosts my website is running ASP.NET 1.1 and IIS 6.  I have a feeling that this is the source of the error that I am experiencing.  I was able to deploy VB 2005 ClickOnce applications.

     

    Does anyone know what the requirements are for a server to successfully deploy VB 2008 ClickOnce applications?  

    Saturday, March 15, 2008 8:53 PM
  •  

    You can serve up a ClickOnce deployment from any server that can serve up files via HTTP or a UNC file path, even a Unix server. You need to check and see if the server has the right MIME file mappings set up.

     

    If they're running Windows Server 2003, that version locks down most file content types by default, so you have to configure the server to allow ClickOnce deployments. If this is your problem, post back and I'll hunt down the article.

     

    I also think if it is a Windows server, and you are deploying the files via HTTP instead of FTP, the server must be running the Front Page Extensions.

     

    Here are the mappings for the files:

     

    The .application file extension needs to be mapped to "application/x-ms-application".

    The .manifest file extension needs to be mapped to "application/x-ms-application".

    The .deploy file extension needs to be mapped to "application/octet-stream".

     

    It usually turns out to be a mapping problem. Good luck. Hope this helps.

     

    RobinS.

    GoldMail.com

     

    Monday, March 17, 2008 4:49 AM
    Moderator
  • RobinS,

     

    Thanks for your suggestions.  Do you know if I have a mapping problem if the deployed, ClickOnce VB 2008 application downloads and runs, if the users click the launch link.  The users only get the "Application Improperly Formatted" error if they click the Run button.  Also when I was deploying VB 2005 applications I did not experience the "Application Improperly Formatted" errors.  I don't know in what part of the ClickOnce deployment process the mappings are critical.

     

    I still don't know if the ASP.NET 1.1 and IIS 6 that are installed on my ISP's server are adequate for deploying VB 2008 applications; they seemed to work for VB 2005 applications. 

    Monday, March 17, 2008 3:23 PM
  • That's really weird. You can install from a VS2008 deployment if they select "download" and then run the setup.exe, but if they just click Run it doesn't work? Does this happen for all of your users?

     

    Do your users already have the application installed, and it's trying to pick up an update, or are they doing a fresh install? Can you check and make sure none of the files are in their deployment folders from their failed attempts?

     

    I don't think it's an IIS problem; I had IIS 6 installed on my old XP machine, and could still host a deployment. I don't know about the .Net 1.1, but I think if they had the MIME mappings set up correctly, it wouldn't be a problem. Can they doublecheck and see if they do?

     

    When I look at http://msdn2.microsoft.com/en-us/library/ms229001(VS.80).aspx there is a mention of this problem, and it says the Log File says "XML signature is invalid" -- are you seeing that in the log file?

     

    Are you checking one of the versions of the .Net Framework in the Prerequisites tab, and if so, which one? If not, are you certain the machine you're trying to install on has the .Net Framework installed already?

     

    You said this in one of your earlier posts: I have a comment about the deployment window.  My users, in general, do not know if they have the required prerequisites; only the techie folks know.  I would hope that the RUN button would first check for the prerequisites.  If they needed to be downloaded, ClickOnce should open a message box giving the user the option to accept or cancel the download.  After the prerequisite issues are resolved ClickOnce should then proceed with the application download.  If ClickOnce worked this way the prerequisite information on the deployment webpage would be unnecessary; the prerequisite information could be presented in the message box if required

     

    This IS how it works. I don't understand what you mean by "the prerequisite information on the deployment webpage would be unnecessary". If you're talking about the listing of prerequisites on the publish.htm page that is normally created by VS (unless you have turned it off), that's just informational. You should be including the prerequisites when you deploy your application.

     

    When you say the website is running ASP.Net 1.1, do you mean they only have the .Net 1.1 framework installed?

     

    Can you post the log file that is created when the deployment fails? Are any of the files being copied over to the machine?

     

    Are you publishing directly out of VS, or are you using Mage or MageUI to change the deployment information? Are you editing any of the deployment files after they are created?

     

    Are you using a beta version of VS2008, or the RTM version?

     

    Have you filled in the Publisher Name and Product Name under the Publish Options?

     

    Let's see if any of these questions help.

     

    RobinS.

    GoldMail.com

    Tuesday, March 18, 2008 1:08 AM
    Moderator
  • Problem Solved!!!

     

    I talked to the tech support people at the ISP that is hosting my wedbsite and they moved my website to a server that is running ASP.NET 3.5.  This seems to have solved the problem.  I don't know how this solved the problem, but for now all is well.

    Tuesday, March 18, 2008 2:56 PM
  •  

    That's great news. Thanks for posting back. Congratulations!

     

    RobinS.

    GoldMail.com

     

    Tuesday, March 18, 2008 4:46 PM
    Moderator
  • Recently I started seeing the issues with ClickOnce applications on few of the systems out of 1000s and solution I would like to share with you all. I am sure your problem was solved... but I found some solution (apologies if this information is already known to you all) which might be interesting to you all.

     

    Error:
    “Cannot continue. The application is improperly formatted. Contact the application vendor for assistance.” occurs when launching application with ClickOnce.
     

    Possible Cause:
    Dfsvc.exe  fail to query “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\AppData”

    Simple Possible Fix:
    Create a Registry Key "AppData “(Type:  REG_EXPAND_SZ) under “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders” with value “%USERPROFILE%\Application Data "

     

    More Details:

    If you still have issues some tips to track the issue on client side can be found at my posting:

    http://www.theinstall.com/PublicOneDocComments.asp?DocumentID=7&ID=1

     

    Monday, August 4, 2008 8:26 PM
  • I had similar problems using .net 2008. Thanks for the workout. It seemed I had a reference to my program too. After deleting it, installing went fine.

     

    thx

    Rob

    Wednesday, April 21, 2010 2:49 PM
  • Yep, worked for me. In the references the application was self referenced. Twice. I removed them and Bingo!
    Saturday, August 27, 2011 12:10 PM
  • I found same message.

    .

    My project's exe from debug folder itself is found in reference.

    which i think undesired.

    Removing that reference solves my problem 

    • Proposed as answer by Bharat KM Friday, September 19, 2014 9:46 AM
    Monday, September 15, 2014 2:07 PM