Asked by:
Problem Testing ClickOnce from LocalHost

Question
-
User-1809947162 posted
I am trying to test a ClickOnce deployment using LocalHost.
I have a web site project called “JazzSoftware”, and a VB project called “Jazz”. Jazz is deployed as a ClickOnce application invoked from JazzSoftware.
When I promote both JazzSoftware and Jazz to production, when the “Run Jazz” link on the web site is clicked JazzSoftware executes
Response.Redirect("~/Jazz/Jazz.application?" & QStr)
This invokes Jazz and everything works as it should.
However when I run JazzSoftware from Visual Studio with LocalHost “Run Jazz” fails with message
Cannot Start Application
Cannot continue. The application is improperly formatted. Contact the application vendor for assistance.
Details include
+ Exception reading manifest from http://localhost:65354/Account/Login.aspx?ReturnUrl=%2fJazz%2fJazz.application%3fUserid%3drobertb%26Status%3dA%26Site%3dJazz%26Expiry%3d2020.01.01%26DownLoad%3d14%2520Jan%25202017%252016%3a26&Userid=robertb&Status=A&Site=Jazz&Expiry=2020.01.01&DownLoad=14%20Jan%202017%2016:26: the manifest may not be valid or the file could not be opened.
+ DTD is prohibited in this XML document.
I get the same results with
Response.Redirect("http://localhost:65354/Jazz/Jazz.application?" & QStr)
Response.Redirect("/Jazz/Jazz.application?" & QStr)I can invoke the production version with
Response.Redirect("http://www.jazzsoftware.co.nz/Jazz/Jazz.application?" & QStr)
If I navigate to Jazz/Jazz.application and click it, the latest (=test) version of Jazz starts up normally. Without a query string obviously, but that’s OK.I tried putting the file path into the Response.Redirect: -
If Debugger.IsAttached Then
Response.Redirect("C:\path\Jazz\Jazz.application?" & QStr)
Else
Response.Redirect("~/Jazz/Jazz.application?" & QStr)
End IfThe debugger showed that the expected Response.Redirect was invoked, but nothing happened – no messages, the program wasn’t invoked. I don’t know whether it’s relevant, but the whole path is quite long – 100 characters including the bits shown.
I tried using a file URI, but both
Response.Redirect("file:///Jazz/Jazz.application?" & QStr)
Response.Redirect("file://localhost:65354/Jazz/Jazz.application?" & QStr)
brought response “Corrupted Content Error”.
What do I do next? I’m out of ideas, and I haven’t found anything useful by searching the web.FWIW, I'm using Windows 7, Visual Studio 2010, .NET 4.0
Thank you, Robert
Saturday, January 14, 2017 10:40 PM
All replies
-
User-2057865890 posted
Hi Robert,
One of the manifest files in the deployment is syntactically not valid, or contains a hash that cannot be reconciled with the corresponding file. This error may also indicate that the manifest embedded inside an assembly is corrupted. Re-create your deployment and recompile your application, or find and fix the errors manually in your manifests.
#Troubleshooting Specific Errors in ClickOnce Deployments
https://msdn.microsoft.com/en-us/library/ms229001.aspx
Best Regards,
Chris
Monday, January 16, 2017 6:42 AM -
User-1809947162 posted
Thank you Chris.
I had a look at
#Troubleshooting Specific Errors in ClickOnce DeploymentsThe most relevant heading is "Error: "Cannot start the application". Under this it says
Verify that your file paths are not longer than 100 characters. If your application contains file paths that are too long, you may exceed the limitations on the maximum path you can store. Try shortening the paths and reinstall.
This seems likely. I had noted that my path was "C:\path\Jazz\Jazz.application?" & QStr but also said that it was quite long. With "path" replaced the actual path is
C:\Users\Advanced Computers\Documents\Visual Studio 2010\Projects\JazzSoftware\Jazz\Jazz.applicationwhich is actually 110 characters. So I'll try this out tomorrow morning, and let you know how it goes.
Monday, January 16, 2017 10:02 AM -
User-1809947162 posted
That didn't work. Nor did another build (publish), even though the Jazz build was error free. So I guess I have to find and fix the errors in the manifest. How do I do this? Or better yet, how do I prevent the errors when I build Jazz?
Monday, January 16, 2017 11:48 PM -
User-2057865890 posted
Hi Robert,
Cannot Start Application
Cannot continue. The application is improperly formatted. Contact the application vendor for assistance.Take a look at https://blogs.msdn.microsoft.com/smondal/2012/08/24/signaturedescription-could-not-be-created-for-the-signature-algorithm-supplied/ and have a try. Note: Every time that you update the manifest you must also sign it again.
reference: https://msdn.microsoft.com/en-us/library/ms228996.aspx
Best Regards,
Chris
Wednesday, January 25, 2017 3:28 AM