BrentMize-3034 avatar image
0 Votes"
BrentMize-3034 asked BrentMize-3034 answered

How to diagnose clickonce deployment of WPF application - Exception reading manifest from file - the manifest may not be valid or the file could not be opened.

I have a .net 6.0 WPF application that I am trying to test clickonce deployment using a Windows Server 2016 target. I have tried many changes based on posts that I've read related to this subject "Exception reading manifest from file" however the message remains the same. I have removed a config file, excluded deployment reference to language resource files and removed a reference to dpiAware setting in the app.manifest. How can I determine what is causing the failure to read the application manifest file?

Other attempts to solve the issue:

  1. Check .application and .manifest files for being well formed.

  2. Tried opening and saving again using MageUI

  3. Defining / Clearing Strong name on app and libraries and Test Cert on deployment manifest

  4. Setting the deployment site as intranet zone

  5. Create minimal WPF app using vs2022 and click-once deployment worked with it!

Both IIS and UNC deployments produce the same result.

Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of resulted in exception. Following failure messages were detected:
+ Exception reading manifest from the manifest may not be valid or the file could not be opened.
+ Parsing and DOM creation of the manifest resulted in error. Following parsing errors were noticed:
-HRESULT: 0x8007001f
Start line: 0
Start column: 0
Host file:
+ A device attached to the system is not functioning. (Exception from HRESULT: 0x8007001F)

· 6
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,@BrentMize-3034. Welcome Microsoft Q&A.
You could try to check the following:

Do you have .NET 6 installed on your computer?
Are you making any changes to the deployment after publishing it?
If you are manually moving the files to the deployment location, is the structure identical to the original structure?

You can also see if the solutions from thread 1 and thread 2 help you.

0 Votes 0 ·

Yes, .Net 6 is installed. Ran windowsdesktop-runtime-6.0.3-win-x64.exe on the target system and tested the application with an xcopy installation before trying to deploy on using clickonce. I am not making changes to the deployment after publishing. I am using RoboCopy to copy the published files to the IIS virtual directory. because of your question I changed the flags with RoboCopy to use "/MIR" to mirror (instead of /E). I've also tried starting the whole publishing process from scratch by removing the ClickOnceProfile.pubxml file and starting the publish process over from vs2022. I've also set the Registry entries for the verbose log file to get more detail. None of this makes any difference.

0 Votes 0 ·

Hi,@BrentMize-3034. Are there some Nuget packages referenced in your project? You could try to see the solution here.

0 Votes 0 ·
Show more comments

1 Answer

BrentMize-3034 avatar image
0 Votes"
BrentMize-3034 answered

Hi @HuiLiu-MSFT,

I was able to solve the problem by re-building my project from scratch starting with a new Solution and new WPF app and class libraries starting in vs2022 .net 60. I then copied on the *.cs files, added the exact same nuget packages and re-referenced each class library. I kept the same namespaces but slightly altered my project names. It took some doing but it now at least deploys to the same target VM without the can't read manifest errors. I do get a database connect error after deployment, but that was expected.

I failed to mention in my original post that I started my project as a .net core 3.1 (vs2019) originally and migrated to .net 6.0. I did not realize that it was significant because my app has been running in .net 6.0 for some time now without problems. I may go back and compare all of the project files and see if I can find something specific, if so, I'll post it.

I hope this may help someone else.

Thanks so much for your help.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.