Unable to load DLL 'Microsoft.DiaSymReader.Nat

2019-06-27 19:47发布

问题:

I am working on a project which is built under 4.7.1. when I rebuild the solution, getting following error.

Error CS0041 Unexpected error writing debug information -- 'Unable to load DLL 'Microsoft.DiaSymReader.Native.amd64.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)' project name Location name\CSC 1 N/A

I have tried to install dll from nuget (Could not find Microsoft.DiaSymReader.Native.x86.dll). but no luck.

environment:

Windows 7 VisualStudio 2017 community edition.

回答1:

Try deleting it

<PropertyGroup>
<Deterministic>true</Deterministic>
</PropertyGroup>

When the attribute of Deterministic is set to true, the DLL / EXE files generated by your program compilation will be determined. The HASH values of these files are the same no matter how many times they are regenerated. This is a great feature, but at the same time it can cause compilation errors. You can refer to this blog for more details blog.paranoidcoding.com/2016/04/05/….



回答2:

I had the same problem (and few more similar errors with dlls). Solved it by installing missing KBs.

KB3118401: https://support.microsoft.com/en-us/help/3118401/update-for-universal-c-runtime-in-windows

KB2533623: https://support.microsoft.com/en-us/help/2533623/microsoft-security-advisory-insecure-library-loading-could-allow-remot