오류

 

위치한 어셈블리의 매니페스트 정의가 어셈블리 참조와 일치하지 않습니다. (HRESULT의 예외: 0x80131040)

 

 

 

현상

 

VC100을 VC141로 업그레이드하는 도중에 발생했습니다. 실행은 되지만 해당 함수에서 false를 반환하고 해당 기능이 동작하지 않는 현상이 있습니다. 그냥 죽었으면 바로 알았을 텐데 출력 로그에만 찍히고 프로그램의 다른 기능은 잘 돌아서 놓치고 있던 문제였습니다.

 

출력 로그를 확인해보니 다음과 같은 에러 메시지가 확인됩니다.

 

[Exception] : SendErrorMessage - 파일이나 어셈블리 'Newtonsoft.Json
, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' 또는 여기에 종속되어 있는 파일이나 어셈블리 중 하나를 로드할 수 없습니다. 찾은 어셈블리의 매니페스트 정의와 어셈블리 참조가 일치하지 않습니다. (예외가 발생한 HRESULT: 0x80131040)

 

 

원인

 

MSDN의 다음 글을 확인해 봅시다: The located assembly's manifest definition doesn't match the assembly reference

 

Assembly Manifest doesn't match reference - .NET Framework

This article describes a problem that cdf-ms files may be deleted when the Framework 3.5 Service pack 1 is installed and the ClickOnce store is used for the first time, and provides a resolution.

docs.microsoft.com

 

해당 문서는 .Net에 관련된 문서지만 예외 코드가 같으니 그냥 봅니다. 중간에 원인으로 다음과 같이 설명하고 있습니다.

 

When Microsoft .NET Framework 3.5 Service pack 1 is installed and the ClickOnce store is used for the first time, cdf-ms files may be deleted. This can also be caused by deleting the registry key HKEY_CURRENT_USER\Software\Classes\Software\Microsoft\Windows\CurrentVersion\Deployment\ClickOnce35SP1Update. The missing cdf-ms files will cause ClickOnce to wrongly share strong named assembly with the same version but different file hash.

 

문제가 생기는 dll의 버전을 확인해 봅시다.

 

 

라이브러리에 사용된 dll의 버전과 응용 프로그램에서 사용하려고 하는 dll의 버전이 달라 발생하는 문제였습니다. 해당 버전 불일치 문제를 수정해주면 정상 동작하는것을 확인할 수 있습니다.

 

 

 

 

 

반응형

+ Recent posts