The loader manifest is not trusted.

Add-in Express™ Support Service
That's what is more important than anything else

The loader manifest is not trusted.
 
Kevin Du




Posts: 10
Joined: 2017-07-08
I develop an addin using Winforms, and today when I debug, some mistakes come, I have no idea what is wrong, and my dll file is strong signed.
Here is the adxloader.log:


Add-in Express Loader Log File: 07/08/2017 21:09:17:037

Startup directory: C:\NetProjects\SalesEnergyRep\SalesEnergyManager\bin\Debug\
Loader version: 8.6.4408.0
Operating System: Microsoft Windows 10 Professional (build 15063), 64-bit
Process Owner: Administrator
Command Line: "C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE"
Run 'As Administrator': Yes
Process Elevated: Yes
Integrity Level: High
UAC (User Account Control): On
------------------------------------------------------------------------
21:09:17:041 4112 2600 Start.
21:09:17:042 4112 2600 The minimum supported Office version is 11
21:09:17:042 4112 2600 The host's version is 16.0.8229.2073
21:09:17:042 4112 2600 Creating a new instance of the add-in loader.
21:09:17:042 4112 2600 Loading mscoree.dll
21:09:17:043 4112 2600 Success.
21:09:17:043 4112 2600 Loading the configuration from the system registry.
21:09:17:047 4112 2600 Getting the latest CLR version.
21:09:17:049 4112 2600 The latest CLR version is 'v4.0.30319'.
21:09:17:049 4112 2600 The configuration has been loaded successfully.
21:09:17:049 4112 2600 Runtime version: v4.0.30319.
21:09:17:049 4112 2600 Assembly name: SalesEnergyManager, PublicKeyToken=8FD500E0EECCC24D.
21:09:17:049 4112 2600 Class name: SalesEnergyManager.AddinModule.
21:09:17:049 4112 2600 Registry key: CLSID\{E44D3777-7709-407A-82B1-62411A4331DB}.
21:09:17:049 4112 2600 Attempting to create a new instance of the managed add-in class: CLR - v4.0.30319
21:09:17:049 4112 2600 Loading CLR: v4.0.30319.
21:09:17:049 4112 2600 Calling CLRCreateInstance method.
21:09:17:049 4112 2600 Success.
21:09:17:049 4112 2600 Calling GetRuntime method.
21:09:17:050 4112 2600 Success.
21:09:17:050 4112 2600 Checking if the hosting API of .NET Framework v4.0 beta is installed.
21:09:17:160 4112 2600 The hosting API is up to date.
21:09:17:160 4112 2600 Calling GetInterface method for the CorRuntimeHost interface.
21:09:17:160 4112 2600 Success.
21:09:17:160 4112 2600 Starting CLR...
21:09:17:160 4112 2600 Success.
21:09:17:160 4112 2600 Getting the CLR version.
21:09:17:160 4112 2600 The CLR v4.0.30319 has been initialized successfully.
21:09:17:160 4112 2600 The loader manifest is not trusted.
21:09:17:160 4112 2600 Hash verification failed(This string is in Chinese, and I tanslate it into English)[B].

Please Help me out. Thank you very much.
Posted 08 Jul, 2017 09:15:31 Top
Andrei Smolin


Add-in Express team


Posts: 14094
Joined: 2006-05-11
Hello Kevin,

Does building the project produce any warning?

Also make sure you take the manifest and project output from the same location - the output folder of your add-in project. Check if the project output is modified (e.g. by obfuscating) after you build the add-in.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 10 Jul, 2017 03:49:27 Top
Kevin Du




Posts: 10
Joined: 2017-07-08
There is no warnings during the building, but Excel fails to load the addin.
I use .Net Reactor to protect my assembly, after I disable the protection, the error comes.
I have tried to rebuild the whole project, but It doesn't work.
How could I solve this problem? Thank you.
Posted 10 Jul, 2017 04:20:07 Top
Andrei Smolin


Add-in Express team


Posts: 14094
Joined: 2006-05-11
Kevin,

The issue occurs if the hash information stored in the manifest doesn't match the hash of the add-in assembly. Consider these possibilities:

- the manifest or assembly is modified after you build the add-in
- you use an older version of the assembly, or an older version of the manifest
- the manifest or assembly is not signed

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 10 Jul, 2017 06:02:51 Top
Kevin Du




Posts: 10
Joined: 2017-07-08
Hi, Andrei
Thank you for your advice and patience。

I have not solved my problem. Since I am not a full-time software professionals, and I programme in my spare time, I think I need some more specific advice for getting everything ok.
About the three situations:
- the manifest or assembly is modified after you build the add-in : How to find my manifest or assembly is modified, and get it right?
- you use an older version of the assembly, or an older version of the manifest : How to get the latest version of the assembly or manifest?
- the manifest or assembly is not signed : I do not have a digit-signed certificate, so I do not think this is the reason.

Thank you very much, and getting this problem fixed is very important for me.
Posted 10 Jul, 2017 11:41:31 Top
Andrei Smolin


Add-in Express team


Posts: 14094
Joined: 2006-05-11
Hello Kevin,

Kevin Du writes:
I do not have a digit-signed certificate, so I do not think this is the reason.


The log file in your first post shows that you use some certificate to sign the add-in. If you don't want to sign your add-in, right-click your add-in project in Solution Explorer, choose Add-in Express | Signing Options in the context menu and clear the "Sign project output, loader and manifest" check box.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 11 Jul, 2017 03:31:36 Top
Kevin Du




Posts: 10
Joined: 2017-07-08
Hi, Andrei
I find that it is the code-signed certificate that causes the error.
What I do not understand is that I try to create a new test certificate and sign the add-in, The add-in is loaded by Excel normally.
But when I clear the "Sign project output, loader and manifest" check box,rebuilt the assembly, and re-register the add-in. After that launch the debug, then sadly The add-in can not be loaded by Excel, and the same error comes again.
How can I solve this error once for all
Posted 11 Jul, 2017 04:35:58 Top
Andrei Smolin


Add-in Express team


Posts: 14094
Joined: 2006-05-11
Kevin,

Your add-in should be signed with a valid certificate to not depend on Excel settings. If you doesn't sign your add-in, Excel settings should let unsigned add-ins to load.

Kevin Du writes:
and the same error comes again


The same error? Do you mean "Hash verification failed" in adxloader.log?

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 11 Jul, 2017 04:45:36 Top
Kevin Du




Posts: 10
Joined: 2017-07-08
Yes, same "Hash verification failed" Error.
Posted 11 Jul, 2017 05:09:03 Top
Andrei Smolin


Add-in Express team


Posts: 14094
Joined: 2006-05-11
That is, you build the add-in with Signing Options specifying *not* to sign the add-in, loader, and manifest, and you still get "Hash verification failed"? If so, it looks like you still sign your add-in. If the issue doesn't occur when you register a new empty add-in project, then you can compare your actual project with the new project.

Kevin Du writes:
How to find my manifest or assembly is modified, and get it right?


Compare your project with the empty project; see above.

Kevin Du writes:
How to get the latest version of the assembly or manifest?


These are located in the output folder of your project unless you move them in the PostBuildEvent.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 11 Jul, 2017 08:06:51 Top