Hash verification failed after crash

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

Hash verification failed after crash
After a windows 10 blue screen crash a previously OK add-in project now gives "Hash verification failed" 
Mike VE




Posts: 168
Joined: 2007-09-09
Hi

At the end of last week I had a Windows 10 blue screen crash. It has affected the add-in project I was working on. When I run Outlook the message "Hash verification failed" appears. The add-in is there in the COM Add-ins list but it does not run and no log is produced. Even updating the project in my GIT repository and downloading it on another machine produces the same result on another machine.

All my other add-in projects seem fine.

I presume it is some kind of corruption caused by the crash. What can I do?
Posted 12 Jul, 2016 02:51:20 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello Mike,

Does building the project produce any warning?


Andrei Smolin
Add-in Express Team Leader
Posted 12 Jul, 2016 03:52:15 Top
Mike VE




Posts: 168
Joined: 2007-09-09
Yes. Several are to do with the code and I understand them to be non-critical. The last one is detailed below.

Severity Code Description Project File Line Suppression State
Warning Add-in Express for Microsoft Office and .NET error: Signing failed (PrintForTrial). Root element is missing.
------------------------------------------------------------------------------------------------------------
Date and Time: 12/07/2016 12:52:31 PM
Machine Name: CHILLBLAST8
IP Address: fe80::ec1c:360a:13aa:418c%8
Current User: CHILLBLAST8\Mike

Application Domain: DefaultDomain
Assembly Codebase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
Assembly Full Name: System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Assembly Version: 4.0.0.0

Exception Source: System.Xml
Exception Type: System.Xml.XmlException
Exception Message: Root element is missing.
Exception Target Site: Throw

---- Stack Trace ----
System.Xml.XmlTextReaderImpl.Throw(e As Exception)
System.Xml.dll: N 0039 (0x27) IL
System.Xml.XmlTextReaderImpl.ParseDocumentContent()
System.Xml.dll: N 0000 (0x0) IL
System.Xml.XmlTextReaderImpl.Read()
System.Xml.dll: N 0140 (0x8C) IL
System.Xml.XmlLoader.Load(doc As XmlDocument, reader As XmlReader, preserveWhitespace As Boolean)
System.Xml.dll: N 0166 (0xA6) IL
System.Xml.XmlDocument.Load(reader As XmlReader)
System.Xml.dll: N 0046 (0x2E) IL
System.Xml.XmlDocument.Load(filename As String)
System.Xml.dll: N 0019 (0x13) IL
AddinExpress.Projects.Common.Signer.RemoveSignatureFromLoaderManifest(manifestPath As String)
System.Xml.dll: N 0006 (0x6) IL
AddinExpress.Projects.Common.Signer.SignLoaderManifest(certificate As X509Certificate2, manifestPath As String, assemblyHash As String, assemblyName As String)
System.Xml.dll: N 0000 (0x0) IL
AddinExpress.Projects.Common.Registrator.SignProject(project As Project, projectFolder As String, primaryOutput As String, intermediateDir As String, supportLoader As Boolean)
System.Xml.dll: N 0888 (0x378) IL PrintForTrial System.Xml 0
Posted 12 Jul, 2016 07:05:17 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Mike,

It looks like the adxloader.dll.manifest file is broken on your PC. Can you open the file in Notepad.exe and edit?
Posted 12 Jul, 2016 08:25:42 Top
Mike VE




Posts: 168
Joined: 2007-09-09
If I open it in Notepad there is nothing there. In Notepad++ there is a screenful of Nulls.

How do I force its recreation?
Posted 12 Jul, 2016 10:01:23 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello Mike,

Is there a copy of it? If you created an installer, the manifest is included in it.


Andrei Smolin
Add-in Express Team Leader
Posted 12 Jul, 2016 10:20:10 Top
Mike VE




Posts: 168
Joined: 2007-09-09
I went back in my GIT repository and got an earlier version of the manifest and copied it into place. The ADX Register command runs as expected but when I debug, Outlook starts but no breakpoints are hit, my add-in does not appear either in the interface or the list of COM add-ins, and no adxloader.log is produced.

If I use the setup.exe and msi produced by the setup project it will install and run correclty on another machine.

I have looked at the manifests on both machines and the only difference I can spot is that the hash value is different. Should that be the case?
Posted 14 Jul, 2016 03:16:41 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello Mike,

I suppose you talk about PublicKeyToken. If so, you can retrieve it using sn.exe from Windows SDK; see https://msdn.microsoft.com/en-us/library/k5b5tt23(v=vs.110).aspx. A way to use this utility is described at https://blogs.msdn.microsoft.com/kaevans/2008/06/18/getting-public-key-token-of-assembly-within-visual-studio/.

Also, check https://www.add-in-express.com/docs/net-deploying-debugging-tips.php#breakpoints.


Andrei Smolin
Add-in Express Team Leader
Posted 14 Jul, 2016 04:11:15 Top
Mike VE




Posts: 168
Joined: 2007-09-09
Thanks, Sergei.

I used the tool you suggested and it confirmed that the PublicKeyToken was right. There is a separate hash number in the manifest. I tried deleting it but when I ran the ADX Register command it was re-inserted. There is also a signature section. I tried commenting it out but that made no difference. Neither of these are in another addin project which is working OK.

I have checked the breakpoints issue. I normally work in >NET 4.5.1 so I get Edit and continue but releases are in NET 3.5 for compatibility with existing customers.
Posted 14 Jul, 2016 04:44:01 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Mike,

Is it possible that your add-in is a) installed and b) registered from the IDE at the same time? If so, uninstall the add-in and unregister it, then make sure there's no trace of it in Outlook.


Andrei Smolin
Add-in Express Team Leader
Posted 14 Jul, 2016 05:26:51 Top