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.

Brent Mize 1 Reputation point
2022-07-25T22:25:50.437+00:00

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.

ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of http://172.16.8.73/TestWeb/Deploy/EMS/EMS.WpfApp1.application resulted in exception. Following failure messages were detected:

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,646 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Brent Mize 1 Reputation point
    2022-07-29T22:24:56.5+00:00

    Hi @Hui Liu-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.

    0 comments No comments