< BACK TO BLOG

μ–΄μ…ˆλΈ”λ¦¬ 바인딩 λ‘œκΉ…

πŸ—“οΈ2016-08-29

λŸ°νƒ€μž„Runtime에 μ–΄μ…ˆλΈ”λ¦¬ 바인딩 였λ₯˜κ°€ λ°œμƒν•˜λŠ” 경우 μ•„λž˜μ™€ 같은 λ‚΄μš©μ„ 확인할 수 μžˆμŠ΅λ‹ˆλ‹€.

이 λŒ€ν™” μƒμž λŒ€μ‹  JIT(Just-in-time) 디버깅을 ν˜ΈμΆœν•˜λŠ”
방법에 λŒ€ν•œ μžμ„Έν•œ λ‚΄μš©μ€ 이 λ©”μ‹œμ§€μ˜ 뒷뢀뢄을 μ°Έμ‘°ν•˜μ‹­μ‹œμ˜€.

************** μ˜ˆμ™Έ ν…μŠ€νŠΈ **************
System.IO.FileNotFoundException: νŒŒμΌμ΄λ‚˜ μ–΄μ…ˆλΈ”λ¦¬ 'SampleNamespace, Version=1.0.0.1, Culture=neutral, PublicKeyToken=aaaaaaaaaaaaaaaa' λ˜λŠ” 여기에 μ’…μ†λ˜μ–΄ μžˆλŠ” νŒŒμΌμ΄λ‚˜ μ–΄μ…ˆλΈ”λ¦¬ 쀑 ν•˜λ‚˜λ₯Ό λ‘œλ“œν•  수 μ—†μŠ΅λ‹ˆλ‹€. μ§€μ •λœ νŒŒμΌμ„ 찾을 수 μ—†μŠ΅λ‹ˆλ‹€.
파일 이름: 'SampleNamespace, Version=1.0.0.0, Culture=neutral, PublicKeyToken=aaaaaaaaaaaaaaaa'
   μœ„μΉ˜: OtherNamespace.MyClass..ctor()

κ²½κ³ : μ–΄μ…ˆλΈ”λ¦¬ 바인딩 λ‘œκΉ…μ΄ κΊΌμ Έ μžˆμŠ΅λ‹ˆλ‹€.
μ–΄μ…ˆλΈ”λ¦¬ 바인딩 였λ₯˜ λ‘œκΉ… κΈ°λŠ₯을 μ‚¬μš©ν•˜λ €λ©΄ λ ˆμ§€μŠ€νŠΈλ¦¬ κ°’ [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD)λ₯Ό 1둜 μ„€μ •ν•˜μ‹­μ‹œμ˜€.
μ°Έκ³ : μ–΄μ…ˆλΈ”λ¦¬ 바인딩 였λ₯˜ λ‘œκΉ… κΈ°λŠ₯을 μ‚¬μš©ν•˜λ„λ‘ μ„€μ •ν•˜λ©΄ 그렇지 μ•Šμ€ κ²½μš°λ³΄λ‹€ μ„±λŠ₯이 μ•½κ°„ λ–¨μ–΄μ§‘λ‹ˆλ‹€.
이 κΈ°λŠ₯을 끄렀면 λ ˆμ§€μŠ€νŠΈλ¦¬ κ°’ [HKLM\Software\Microsoft\Fusion!EnableLog]λ₯Ό μ œκ±°ν•˜μ‹­μ‹œμ˜€.



************** λ‘œλ“œλœ μ–΄μ…ˆλΈ”λ¦¬ **************
mscorlib
    μ–΄μ…ˆλΈ”λ¦¬ 버전: 4.0.0.0
    Win32 버전: 4.0.30319.34209 built by: FX452RTMGDR
    μ½”λ“œλ² μ΄μŠ€: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
System
    μ–΄μ…ˆλΈ”λ¦¬ 버전: 4.0.0.0
    Win32 버전: 4.0.30319.34238 built by: FX452RTMGDR
    μ½”λ“œλ² μ΄μŠ€: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
    μ–΄μ…ˆλΈ”λ¦¬ 버전: 4.0.0.0
    Win32 버전: 4.0.30319.34251 built by: FX452RTMGDR
    μ½”λ“œλ² μ΄μŠ€: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    μ–΄μ…ˆλΈ”λ¦¬ 버전: 4.0.0.0
    Win32 버전: 4.0.30319.34209 built by: FX452RTMGDR
    μ½”λ“œλ² μ΄μŠ€: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    μ–΄μ…ˆλΈ”λ¦¬ 버전: 4.0.0.0
    Win32 버전: 4.0.30319.34209 built by: FX452RTMGDR
    μ½”λ“œλ² μ΄μŠ€: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    μ–΄μ…ˆλΈ”λ¦¬ 버전: 4.0.0.0
    Win32 버전: 4.0.30319.34234 built by: FX452RTMGDR
    μ½”λ“œλ² μ΄μŠ€: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
OtherNamespace.MyClass
    μ–΄μ…ˆλΈ”λ¦¬ 버전: 1.0.0.0
    Win32 버전: N/A
    μ½”λ“œλ² μ΄μŠ€: http://bbon.me/Apps/OtherNamespace.DLL
----------------------------------------
IFW.Windows.Forms
    μ–΄μ…ˆλΈ”λ¦¬ 버전: 4.0.0.6
    Win32 버전: 4.0.0.6
    μ½”λ“œλ² μ΄μŠ€: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/IFW.Windows.Forms/v4.0_4.0.0.6__6b3a265306332740/IFW.Windows.Forms.dll
----------------------------------------
mscorlib.resources
    μ–΄μ…ˆλΈ”λ¦¬ 버전: 4.0.0.0
    Win32 버전: 4.0.30319.34209 built by: FX452RTMGDR
    μ½”λ“œλ² μ΄μŠ€: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_ko_b77a5c561934e089/mscorlib.resources.dll
----------------------------------------
System.Windows.Forms.resources
    μ–΄μ…ˆλΈ”λ¦¬ 버전: 4.0.0.0
    Win32 버전: 4.0.30319.34209 built by: FX452RTMGDR
    μ½”λ“œλ² μ΄μŠ€: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_ko_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------

************** JIT 디버깅 **************
JIT(Just In Time) 디버깅을 μ‚¬μš©ν•˜λ €λ©΄ 이 μ‘μš© ν”„λ‘œκ·Έλž¨ λ˜λŠ” μ»΄ν“¨ν„°μ˜
config 파일(machine.config)의 jitDebugging 값을
system.windows.forms μ„Ήμ…˜μ— μ„€μ •ν•΄μ•Ό ν•©λ‹ˆλ‹€.
λ˜ν•œ μ‘μš© ν”„λ‘œκ·Έλž¨μ€ 디버깅할 수 μžˆλ„λ‘ μ»΄νŒŒμΌλ˜μ–΄μ•Ό
ν•©λ‹ˆλ‹€.

예:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

JIT 디버깅을 μ‚¬μš©ν•˜λ©΄ μ²˜λ¦¬λ˜μ§€ μ•Šμ€ λͺ¨λ“  μ˜ˆμ™ΈλŠ”
이 λŒ€ν™” μƒμžμ—μ„œ μ²˜λ¦¬λ˜μ§€ μ•Šκ³  컴퓨터에 λ“±λ‘λœ JIT
디버거에 λ³΄λ‚΄μ§‘λ‹ˆλ‹€.

μ‘μš© ν”„λ‘œκ·Έλž¨ λŸ°νƒ€μž„μ— μ–΄μ…ˆλΈ”λ¦¬ 바인딩 였λ₯˜ 둜그λ₯Ό ν™œμ„±ν™”ν•˜μ—¬ 문제λ₯Ό 좔적할 수 μžˆμŠ΅λ‹ˆλ‹€.

μ–΄λ–€ μ–΄μ…ˆλΈ”λ¦¬λ₯Ό λ°”μΈλ”©ν•˜λ €λ‹€ 였λ₯˜κ°€ λ°œμƒν•˜λŠ”μ§€λŠ” λ‘œκΉ…μ„ ν™œμ„±ν™”ν•˜λ©΄ 확인할 수 μžˆμŠ΅λ‹ˆλ‹€.

λ‘œκΉ… ν™œμ„±ν™”

λ ˆμ§€μŠ€νŠΈλ¦¬ νŽΈμ§‘κΈ°λ₯Ό μ‹€ν–‰ν•˜κ³  μ•„λž˜ ν‚€λ‘œ 이동 ν›„ 값을 μΆ”κ°€ν•©λ‹ˆλ‹€.

HKLM\SOFTWARE\Microsoft\Fusion

이름 ν˜•μ‹ κ°’
EnableLog DWORD 1
ForceLog DWORD 1
LogFailures DWORD 1
LogResourceBinds DWORD 1
LogPath STRING PATH TO LOG FILES;e.g.)c:\FusionLog\

μ•„λž˜μ™€ 같이 λ ˆμ§€μŠ€νŠΈλ¦¬ 값을 μΆ”κ°€ν•˜λ©΄ λ‘œκΉ…μ΄ ν™œμ„±ν™”λ©λ‹ˆλ‹€.

![](./regedit-fusion-log.png μ„€μ •)

λ‘œκ·Έν™•μΈ

λ ˆμ§€μŠ€νŠΈλ¦¬ κ°’ 쀑 LogPath에 μ„€μ •ν•œ 디렉터리에 둜그 파일이 λ§Œλ“€μ–΄μ§‘λ‹ˆλ‹€.

νƒμƒ‰κΈ°μ—μ„œ λ””λ ‰ν„°λ¦¬λ‘œ μ΄λ™ν•˜λ©΄ Default, NativeImage 두 개의 ν•˜μœ„ 디렉터리가 λ§Œλ“€μ–΄μ Έ μžˆμŠ΅λ‹ˆλ‹€.

그리고, 각 디렉터리에 μ‹€ν–‰λœ μ–΄μ…ˆλΈ”λ¦¬ 이름 디렉터리가 μ‘΄μž¬ν•˜κ³ , HTML 파일둜 λ‚΄μš©μ΄ μ €μž₯λ˜μ–΄μ Έ μžˆμŠ΅λ‹ˆλ‹€.

각 HTMLνŒŒμΌμ„ ν™•μΈν•˜μ—¬ μ‹€νŒ¨ λ‚΄μš©μ„ 좔적할 수 μžˆμŠ΅λ‹ˆλ‹€.

μ–΄μ…ˆλΈ”λ¦¬ 바인딩 λ‘œκΉ… ν™œμ„±ν™” μ‘μš© ν”„λ‘œκ·Έλž¨

ν”„λ‘œμ νŠΈλ₯Ό λΉŒλ“œν•˜κΈ° μœ„ν•΄μ„œλŠ” μ•„λž˜ μš”κ΅¬μ‚¬ν•­μ„ λ§Œμ‘±ν•΄μ•Ό ν•©λ‹ˆλ‹€.

  • Visual Studio 2015
  • .NET Framework 4.5.2

Release νŒŒμΌμ„ λ‹€μš΄λ‘œλ“œ λ°›κ³  μ‹€ν–‰ν•˜λ©΄ μ•„λž˜μ™€ 같이 κ°„λ‹¨ν•œ λͺ¨μ–‘μœΌλ‘œ μ‹€ν–‰λ©λ‹ˆλ‹€.

fusionlog 01

fusionlog 02

Check λ²„νŠΌμœΌλ‘œ ν˜„μž¬ μƒνƒœλ₯Ό 확인할 수 있고, Activate, Deactivate λ²„νŠΌμœΌλ‘œ ν™œμ„±, λΉ„ν™œμ„±μœΌλ‘œ μƒνƒœλ₯Ό λ³€κ²½ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

ν™œμ„±μ€ λ ˆμ§€μŠ€νŠΈλ¦¬μ— 값을 μΆ”κ°€ν•˜κ³ , λΉ„ν™œμ„±μ€ λ ˆμ§€μŠ€νŠΈλ¦¬ 값을 μ œκ±°ν•©λ‹ˆλ‹€.

Github: activate-assembly-binding-error-log

GitHub Repository


Profile picture

Pon Cheol Ku (ꡬ본철)

Software developer

Other sites

If does not find interesting topic, you might visit other site on below link.

Β© 2024, Built with Gatsby