ClickOnce – Exception reading manifest from file
the manifest may not be valid or the file could not be opened
This is a problem that you can run into when you publish an application using ClickOnce.
The error message provided by ClickOnce is a little obscure and there may well be a number of different causes, this posting is about what was causing the problem in my case.
What Causes the Problem?
Multiple references to the same dll(s) (not necessarily just a project reference).
In our case we were pulling in non .net dll’s from two different directories that each contained about 5 dll’s that existed in both directories. Same version and everything, versioning was not causing the problem.
As soon as we removed the duplicates the problem went away.
We also experienced the same problem when we were pulling a configuration file explicitly from one location but had also added the file to the main project. So once again because a file with the same name was ‘included’ in the publish, ClickOnce throws an error because the manifest is invalid.
This guy found the problem was due to an Enterprise Library dll. I don’t know the details but I’d be willing to bet that he had a reference to two different versions of the same dll in two different projects.
While it would be nice to get a clearer error message I think what ClickOnce is doing here is pretty nice. It is making sure that you don’t get into any trouble with different references to the same file…which could be a different version and give you a world of subtle, very difficult to find bugs.
I hope this makes sense…it has been written very quickly 🙂