CLR20r3 오류 해결을 위해 mscorlib.dll을 덮어쓸 때 주의할 점
우연히, 다음과 같은 글을 보게 되었습니다.
[Solved] CLR20r3 오류 해결! mscorlib 문제
; http://sunnyholic.com/archive/20130513
정리해 보면, 3DMark 11 프로그램을 실행하는데 다음과 같은 오류가 발생했고,
오류 버킷 , 유형 0
이벤트 이름: CLR20r3
응답: 사용할 수 없음
Cab ID: 0
문제 서명:
P1: 3dmark11.exe
P2: 1.0.5.0
P3: 516674fb
P4: mscorlib
P5: 4.0.0.0
P6: 4ba22001
P7: 105d
P8: 1c
P9: PSZQOADHX1U5ZAHBHOHGHLDGIY4QIXHX
P10:
오류 있는 응용 프로그램 이름: 3DMark11.exe, 버전: 1.0.5.0, 타임스탬프: 0x516674fb
오류 있는 모듈 이름: KERNELBASE.dll, 버전: 6.1.7601.18015, 타임스탬프: 0x50b8479b
예외 코드: 0xe0434352
오류 오프셋: 0x0000000000009e5d
오류 있는 프로세스 ID: 0x128c
오류 있는 응용 프로그램 시작 시간: 0x01ce4f971b22fe68
오류 있는 응용 프로그램 경로: C:\Program Files\Futuremark\3DMark11\bin\x64\3DMark11.exe
오류 있는 모듈 경로: C:\Windows\system32\KERNELBASE.dll
보고서 ID: 58e3e48d-bb8a-11e2-8c45-bc5ff48f1017
응용 프로그램: 3DMark11.exe
Framework 버전: v4.0.30319
설명: 처리되지 않은 예외로 인해 프로세스가 종료되었습니다.
예외 정보:System.Reflection.TargetInvocationException
스택:
위치: System.RuntimeMethodHandle._InvokeMethodFast(System.IRuntimeMethodInfo, System.Object, System.Object[], System.SignatureStruct ByRef, System.Reflection.MethodAttributes, System.RuntimeType)
위치: System.RuntimeMethodHandle.InvokeMethodFast(System.IRuntimeMethodInfo, System.Object, System.Object[], System.Signature, System.Reflection.MethodAttributes, System.RuntimeType)
위치: System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo, Boolean)
위치: System.Delegate.DynamicInvokeImpl(System.Object[])
위치: System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
위치: MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
위치: System.Windows.Threading.Dispatcher.WrappedInvoke(System.Delegate, System.Object, Int32, System.Delegate)
위치: System.Windows.Threading.DispatcherOperation.InvokeImpl()
위치: System.Threading.ExecutionContext.runTryCode(System.Object)
위치: System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, CleanupCode, System.Object)
위치: System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
위치: System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
위치: System.Windows.Threading.DispatcherOperation.Invoke()
위치: System.Windows.Threading.Dispatcher.ProcessQueue()
위치: System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
위치: MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
위치: MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
위치: System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
위치: MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
위치: System.Windows.Threading.Dispatcher.WrappedInvoke(System.Delegate, System.Object, Int32, System.Delegate)
위치: System.Windows.Threading.Dispatcher.InvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
위치: MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
위치: MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
위치: System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
위치: ?.()
위치: System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
위치: System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
위치: System.Threading.ThreadHelper.ThreadStart()
이를 해결하기 위해 (그 글에 첨부된) mscorlib.dll을 "C:\Windows\Microsoft.NET\Framework\v4.0.30319" 폴더에 덮어썼다는 것입니다. 어쨌든, 오류가 해결되었다니 다행이지만... 호기심이 생기더군요. ^^ 그래서 그 글에 공개한 mscorlib.dll 파일을 다운로드 받아 버전을 확인해 보았습니다.
그 순간, 뜨악~~~ 했습니다. 바로 1.0.3705.288이었고 이는 .NET Framework 1.0 SP2가 설치되었을 때의 mscorlib.dll을 의미합니다. 다시 말해, .NET Framework 4.0이 설치된 폴더에 .NET 1.0 시절의 mscorlib.dll을 덮어써 해결한 것입니다.
그래서 해결이 되었다는 것은 곧! 3dmark11.exe 파일이 .NET 1.0 또는 2.0 대상으로 만들어진 응용 프로그램임을 의미합니다. 이쯤에서 대충 문제가 된 원인을 알 듯합니다. 위의 오류 보고를 보면, "Framework 버전: v4.0.30319"라는 말이 나오는데, .NET 1.0(또는 2.0) 대상의 응용 프로그램이 .NET 4.0에서 호환이 안돼 문제가 발생한 것입니다.
올바른 해결책은, supportedRuntime을 사용했어야 합니다. .NET 4.0에서 문제가 발생했으니 3DMark11.exe.config 파일을 만들어 다음의 내용을 포함시켰다면 잘 해결되었을 것입니다.
<?xml version="1.0"?>
<configuration>
<startup>
<supportedRuntime version="v2.0.50727"/>
</startup>
</configuration>
또는,
<?xml version="1.0"?>
<configuration>
<startup>
<supportedRuntime version="v1.1.4322"/>
</startup>
</configuration>
그나저나 큰일이군요. 저 글을 보고 .NET 4.0 mscorlib.dll을 10년도 더 된 1.0용 mscorlib.dll로 교체한 사람들은... 아마도 이후 .NET 4.0용 응용 프로그램을 실행할 때 또 이상한 문제를 겪을 텐데... ^^;;;
[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]