Tuesday, August 9, 2011

ClickOnce deployment woe resolved...this time


In my case, which is probably not yours but it could be, unused references were the culprit. I removed them and all is golden now. At least until the next problem.

Here's the situation...

Two projects. One deploys fine with ClickOnce, one does not. They are identical as far as the publishing settings so I can't find what's wrong. I glean from the long error message log something about not being able to read the manifest and parse errors.

I'm on my own with this project so I search the internet for help. I'm not alone as it turns out a lot of people have ClickOnce woes and it appears there are no simple answers. All kinds of solutions and workarounds are suggested, some of which I try and some I know aren't the issue and won't help. There are many suggestions to sign the certificate, but unsigned certificates are allowed, and the "good" project is unsigned and deployed just fine. So I continue to search for answers.

I find a blog that suggests duplicate .dll files are at fault. I go to the "bad" project's property page and look at the resources but don't see any duplicates. I select the "Unused References" button and am surprised to see three are listed. Judging from their names they don't appear to be unused. I check the "good" project and there are no unused references there. Hmmm. Interesting. So I back up my project, remove the supposedly unused references and publish again. I hold my breath, waiting for the same error message to appear. And it doesn't. It runs! Hooray!