0

I have a problem running my 1-click application. It stopped working with an error code "Application validation did not succeed". The problem is related to Mono.Cecil.dll and related signature validation.

If I turn publish status of Mono.Cecil.dll to exclude in VisualStudio/Properties/Publish/Application files the app starts working ok for majority of users, but some users report errors with certain functionalities.

Any idea what could be the issue? I took over some legacy code so I am not sure why this dll was included in the code. Previusly it was working ok with this dll and I did not modify it.

Errors:

System.Deployment.Application.InvalidDeploymentException (SignatureValidation) Strong name signature not valid for this assembly Mono.Cecil.dll

burnsi
  • 6,194
  • 13
  • 17
  • 27
  • Depending on how you acquire this assembly (too many possible sources) you might end up with a delayed signed/public signed copy of that assembly. Either you switch to a fully signed version, or you sign it with your own key. Tools like https://github.com/dsplaisted/strongnamer can help. – Lex Li Jan 19 '23 at 16:35
  • I removed and added the whole "dll package" via NuGet manager and now the app works as 1-click. Still unsure how this MonoCecil got added to the project, it wasn't under project References, it was only listed under VS - Properties/Publish/Application files. It must have gotten added indirectly when adding other reference dlls / NuGet packages, – dome_engineer Jan 23 '23 at 07:59

1 Answers1

0

Copied from the comment.

You have to be very careful about what libraries/packages are being referenced by your project, as they can bring harms to your end users if coming from certain sources.

Mono.Cecil, as a famous open source library, has been known to have tons of sources and only its NuGet package or its source code repo on GitHub can be trusted as they are managed by the original author.

The issue disappeared once you resolved that mysterious reference, but you can check out other references to make sure similar things won't happen in the future.

MSBuild bin log can reveal almost everything about the build, so you might start from there.

Lex Li
  • 60,503
  • 9
  • 116
  • 147
  • It seems it got added when I merged a smaller internal app we have into a bigger one we will continue with (with NuGet packages as a source for needed reference files). Still a bit puzzeled about this specific dll but thank you for the MSBuild bin log tip. – dome_engineer Jan 23 '23 at 10:18