티스토리 뷰

오늘도 어김없이 뎁질좀 하다가 스마트클라이언트 관련 질문이 올라왔다.
질문인 즉, Infragistic 컴포넌트를 사용하니 로컬에선 잘 되는데 원격접속시 다운로드가 제대로 되지 않는 것 같다는 것이다.
 
데브피아 Q&A 원문 :
 
아래의 샘플 경로는 접속할 수 없습니다.
우선 예시 상황을 만들어 보았다.
아래는 버추얼PC 로 Infragistic 컴포넌트가 설치가 되지 않는 Windows XP 환경이다.
 
 
Fiddler 를 이용하여 어셈블리 다운로드 상태를 보도록 하자.
 
 
예상대로 어셈블리를 제대로 다운받지 못하여 발생하는 엑박 이라는 것을 알 수 있다.
 
Infragistic 은 최초 설치 시 GAC 에 등록되어 컴포넌트 참조시에 GAC 에 등록된 어셈블리를 참조하게 된다. 때문에, 참조된 어셈블리는 로컬 복사가 이루어 지지 않는다. 더 쉽게 말해, bin 폴더에 Infragistic 의 DLL이 복사되지 않는다.
 
그럼 다음과 같이 참조된 어셈블리를 하나의 DLL 로 떨어질 수 있도록 참조 속성을 변경해주자.
 
 
그럼 다음과 같이 Infragistic 컴포넌트가 설치 되지 않은 PC 에서 정상적으로 작동이 될 것이다.
 
 
C:\Visual Studio 2005 명령 프롬프트>GACUTIL /L
 
위와 같이 비쥬얼 스튜디오 명령 프롬프트를 통해 GAC 에 등록된 어셈블리를 확인할 수 있다.
 
 
만약 예리한 사람이라면 여기에서 굉장히 비효율성을 느낄 것이다.
DLL 모듈의 업데이트가 필요없는 구성요소에 대해 매번 GAC 과 로컬 Cache 를 뒤져가며, 버전체크 하려 할 것이다.
 
Fiddler 를 통해 GAC 에 등록된 어셈블리와 그렇지 않은 어셈블리를 찾아 헤메는 과정이다.
 
#
Result
Protocol
Host
URL
Body
Caching
Content-Type
User-defined
4
404
HTTP
umc.pe.kr
/iexplore.exe.config
1,466
text/html
5
304
HTTP
umc.pe.kr
/sample/Umc.PaintSmartClient.DLL
0
6
404
HTTP
umc.pe.kr
/iexplore.exe.config
1,466
text/html
7
404
HTTP
umc.pe.kr
/ko-KR/System.resources.DLL
1,466
text/html
8
404
HTTP
umc.pe.kr
/ko-KR/System.resources/System.resources.DLL
1,466
text/html
9
404
HTTP
umc.pe.kr
/bin/ko-KR/System.resources.DLL
1,466
text/html
10
404
HTTP
umc.pe.kr
/bin/ko-KR/System.resources/System.resources.DLL
1,466
text/html
11
404
HTTP
umc.pe.kr
/ko-KR/System.resources.EXE
1,466
text/html
12
404
HTTP
umc.pe.kr
/ko-KR/System.resources/System.resources.EXE
1,466
text/html
13
404
HTTP
umc.pe.kr
/bin/ko-KR/System.resources.EXE
1,466
text/html
14
404
HTTP
umc.pe.kr
/bin/ko-KR/System.resources/System.resources.EXE
1,466
text/html
15
404
HTTP
umc.pe.kr
/ko-KR/Infragistics2.Win.UltraWinGrid.v7.1.resources.DLL
1,466
text/html
16
200
HTTP
CONNECT
urs.microsoft.com:443
0
17
404
HTTP
umc.pe.kr
/ko-KR/Infragistics2.Win.UltraWinGrid.v7.1.resources/Infragistics2.Win.UltraWinGrid.v7.1.resources.DLL
1,466
text/html
18
404
HTTP
umc.pe.kr
/bin/ko-KR/Infragistics2.Win.UltraWinGrid.v7.1.resources.DLL
1,466
text/html
19
404
HTTP
umc.pe.kr
/bin/ko-KR/Infragistics2.Win.UltraWinGrid.v7.1.resources/Infragistics2.Win.UltraWinGrid.v7.1.resources.DLL
1,466
text/html
20
404
HTTP
umc.pe.kr
/ko-KR/Infragistics2.Win.UltraWinGrid.v7.1.resources.EXE
1,466
text/html
21
404
HTTP
umc.pe.kr
/ko-KR/Infragistics2.Win.UltraWinGrid.v7.1.resources/Infragistics2.Win.UltraWinGrid.v7.1.resources.EXE
1,466
text/html
22
404
HTTP
umc.pe.kr
/bin/ko-KR/Infragistics2.Win.UltraWinGrid.v7.1.resources.EXE
1,466
text/html
23
404
HTTP
umc.pe.kr
/bin/ko-KR/Infragistics2.Win.UltraWinGrid.v7.1.resources/Infragistics2.Win.UltraWinGrid.v7.1.resources.EXE
1,466
text/html
24
404
HTTP
umc.pe.kr
/ko/Infragistics2.Win.UltraWinGrid.v7.1.resources.DLL
1,466
text/html
25
404
HTTP
umc.pe.kr
/ko/Infragistics2.Win.UltraWinGrid.v7.1.resources/Infragistics2.Win.UltraWinGrid.v7.1.resources.DLL
1,466
text/html
26
404
HTTP
umc.pe.kr
/bin/ko/Infragistics2.Win.UltraWinGrid.v7.1.resources.DLL
1,466
text/html
27
404
HTTP
umc.pe.kr
/bin/ko/Infragistics2.Win.UltraWinGrid.v7.1.resources/Infragistics2.Win.UltraWinGrid.v7.1.resources.DLL
1,466
text/html
28
404
HTTP
umc.pe.kr
/ko/Infragistics2.Win.UltraWinGrid.v7.1.resources.EXE
1,466
text/html
29
404
HTTP
umc.pe.kr
/ko/Infragistics2.Win.UltraWinGrid.v7.1.resources/Infragistics2.Win.UltraWinGrid.v7.1.resources.EXE
1,466
text/html
30
404
HTTP
umc.pe.kr
/bin/ko/Infragistics2.Win.UltraWinGrid.v7.1.resources.EXE
1,466
text/html
31
404
HTTP
umc.pe.kr
/bin/ko/Infragistics2.Win.UltraWinGrid.v7.1.resources/Infragistics2.Win.UltraWinGrid.v7.1.resources.EXE
1,466
text/html
[Fiddler 1] Infragistics 컴포넌트가 GAC 에 등록 되었을 때 Fiddler 다운로드 상태
 
 
 
#                         Result                 Protocol              Host                    URL                     Body                   Caching              Content-Type      User-defined     
5                         404                     HTTP                  umc.pe.kr           /IEXPLORE.EXE.config                   1,466                                            text/html                                      
6                         404                     HTTP                  umc.pe.kr           /IEXPLORE.EXE.config                   1,466                                            text/html                                      
7                         404                     HTTP                  umc.pe.kr           /ko-KR/System.resources.DLL        1,466                                            text/html                                      
8                         404                     HTTP                  umc.pe.kr           /ko-KR/System.resources/System.resources.DLL      1,466                                            text/html                                      
9                         404                     HTTP                  umc.pe.kr           /bin/ko-KR/System.resources.DLL 1,466                                            text/html                                      
10                       404                     HTTP                  umc.pe.kr           /bin/ko-KR/System.resources/System.resources.DLL                          1,466                                            text/html                                       
11                       404                     HTTP                  umc.pe.kr           /ko-KR/System.resources.EXE       1,466                                            text/html                                      
12                       404                     HTTP                  umc.pe.kr           /ko-KR/System.resources/System.resources.EXE      1,466                                            text/html                                      
13                       404                     HTTP                  umc.pe.kr           /bin/ko-KR/System.resources.EXE                           1,466                                            text/html                                      
14                       404                     HTTP                  umc.pe.kr           /bin/ko-KR/System.resources/System.resources.EXE                          1,466                                            text/html                                       
15                       404                     HTTP                  umc.pe.kr           /ko/System.resources.DLL             1,466                                            text/html                                      
16                       404                     HTTP                  umc.pe.kr           /ko/System.resources/System.resources.DLL            1,466                                            text/html                                      
17                       404                     HTTP                  umc.pe.kr           /bin/ko/System.resources.DLL       1,466                                            text/html                                      
18                       404                     HTTP                  umc.pe.kr           /bin/ko/System.resources/System.resources.DLL     1,466                                            text/html                                      
19                       404                     HTTP                  umc.pe.kr           /ko/System.resources.EXE             1,466                                            text/html                                      
20                       404                     HTTP                  umc.pe.kr           /ko/System.resources/System.resources.EXE           1,466                                            text/html                                      
21                       404                     HTTP                  umc.pe.kr           /bin/ko/System.resources.EXE      1,466                                            text/html                                      
22                       404                     HTTP                  umc.pe.kr           /bin/ko/System.resources/System.resources.EXE     1,466                                            text/html                                      
23                       200                     HTTP                  CONNECT           urs.microsoft.com:443                   0                                                                                                       
24                       404                     HTTP                  umc.pe.kr           /ko-KR/Infragistics2.Win.UltraWinGrid.v7.1.resources.DLL                 1,466                                            text/html                                       
25                       404                     HTTP                  umc.pe.kr           /ko-KR/Infragistics2.Win.UltraWinGrid.v7.1.resources/Infragistics2.Win.UltraWinGrid.v7.1.resources.DLL                        1,466                                                     text/html                                      
26                       404                     HTTP                  umc.pe.kr           /bin/ko-KR/Infragistics2.Win.UltraWinGrid.v7.1.resources.DLL          1,466                                            text/html                                       
27                       404                     HTTP                  umc.pe.kr           /bin/ko-KR/Infragistics2.Win.UltraWinGrid.v7.1.resources/Infragistics2.Win.UltraWinGrid.v7.1.resources.DLL                  1,466                                                     text/html                                      
28                       404                     HTTP                  umc.pe.kr           /ko-KR/Infragistics2.Win.UltraWinGrid.v7.1.resources.EXE                1,466                                            text/html                                       
29                       404                     HTTP                  umc.pe.kr           /ko-KR/Infragistics2.Win.UltraWinGrid.v7.1.resources/Infragistics2.Win.UltraWinGrid.v7.1.resources.EXE                        1,466                                                     text/html                                      
30                       404                     HTTP                  umc.pe.kr           /bin/ko-KR/Infragistics2.Win.UltraWinGrid.v7.1.resources.EXE          1,466                                            text/html                                       
31                       404                     HTTP                  umc.pe.kr           /bin/ko-KR/Infragistics2.Win.UltraWinGrid.v7.1.resources/Infragistics2.Win.UltraWinGrid.v7.1.resources.EXE                 1,466                                                     text/html                                      
32                       404                     HTTP                  umc.pe.kr           /sample/ko-KR/Infragistics2.Win.UltraWinGrid.v7.1.resources.DLL    1,466                                            text/html                                       
33                       404                     HTTP                  umc.pe.kr           /sample/ko-KR/Infragistics2.Win.UltraWinGrid.v7.1.resources/Infragistics2.Win.UltraWinGrid.v7.1.resources.DLL           1,466                                                     text/html                                      
34                       404                     HTTP                  umc.pe.kr           /sample/ko-KR/Infragistics2.Win.UltraWinGrid.v7.1.resources.EXE   1,466                                            text/html                                       
35                       404                     HTTP                  umc.pe.kr           /sample/ko-KR/Infragistics2.Win.UltraWinGrid.v7.1.resources/Infragistics2.Win.UltraWinGrid.v7.1.resources.EXE           1,466                                                     text/html                                      
36                       404                     HTTP                  umc.pe.kr           /ko/Infragistics2.Win.UltraWinGrid.v7.1.resources.DLL                      1,466                                            text/html                                       
37                       404                     HTTP                  umc.pe.kr           /ko/Infragistics2.Win.UltraWinGrid.v7.1.resources/Infragistics2.Win.UltraWinGrid.v7.1.resources.DLL   1,466                                             text/html                                      
38                       404                     HTTP                  umc.pe.kr           /bin/ko/Infragistics2.Win.UltraWinGrid.v7.1.resources.DLL                1,466                                            text/html                                       
39                       404                     HTTP                  umc.pe.kr           /bin/ko/Infragistics2.Win.UltraWinGrid.v7.1.resources/Infragistics2.Win.UltraWinGrid.v7.1.resources.DLL                       1,466                                                     text/html                                      
40                       404                     HTTP                  umc.pe.kr           /ko/Infragistics2.Win.UltraWinGrid.v7.1.resources.EXE                      1,466                                            text/html                                       
41                       404                     HTTP                  umc.pe.kr           /ko/Infragistics2.Win.UltraWinGrid.v7.1.resources/Infragistics2.Win.UltraWinGrid.v7.1.resources.EXE   1,466                                             text/html                                      
42                       404                     HTTP                  umc.pe.kr           /bin/ko/Infragistics2.Win.UltraWinGrid.v7.1.resources.EXE               1,466                                            text/html                                       
43                       404                     HTTP                  umc.pe.kr           /bin/ko/Infragistics2.Win.UltraWinGrid.v7.1.resources/Infragistics2.Win.UltraWinGrid.v7.1.resources.EXE                       1,466                                                     text/html                                      
44                       404                     HTTP                  umc.pe.kr           /sample/ko/Infragistics2.Win.UltraWinGrid.v7.1.resources.DLL         1,466                                            text/html                                       
45                       404                     HTTP                  umc.pe.kr           /sample/ko/Infragistics2.Win.UltraWinGrid.v7.1.resources/Infragistics2.Win.UltraWinGrid.v7.1.resources.DLL                 1,466                                                     text/html                                      
46                       404                     HTTP                  umc.pe.kr           /sample/ko/Infragistics2.Win.UltraWinGrid.v7.1.resources.EXE         1,466                                            text/html                                       
47                       404                     HTTP                  umc.pe.kr           /sample/ko/Infragistics2.Win.UltraWinGrid.v7.1.resources/Infragistics2.Win.UltraWinGrid.v7.1.resources.EXE                1,466                                                     text/html                                      
[Fiddler 2] Infragistics 컴포넌트가 GAC 에 등록되지 않았을 때 Fiddler 다운로드 상태
 
URL 등이 중요한 것이 아니라 어셈블리 다운로드를 위해 얼마만큼의 요청이 있었는지의 첫번째 컬럼을 통해 확인해 보자.
GAC 에 등록되지 않은 어셈블리 다운로드 요청 횟수가 GAC 에 등록된 어셈블리 다운로드 요청 횟수에 비해 16회 정도 더 많은 오버헤드를 유발하고 있다.
 
Infragistic 컴포넌트가 어떻게 바인딩 되었는지 로그를 통해 좀더 자세한 정보를 얻을 수 있다.
 
*** 어셈블리 바인더 로그 엔트리 (2007-09-19 @ 오후 11:43:43) ***
 
작업이 완료되었습니다.
바인딩 결과: hr = 0x0. 작업을 완료했습니다.
 
다음 위치에서 어셈블리 관리자 로드: C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
다음 실행 파일에서 실행: C:\Program Files\Internet Explorer\iexplore.exe
--- 자세한 오류 로그가 아래에 표시됩니다.
 
=== 미리 바인딩된 상태 정보 ===
로그: 사용자 = PowerUmc\엄준일
로그: DisplayName = Infragistics2.Win.v7.1, Version=7.1.20071.40, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb
 (Fully-specified)
로그: Appbase = http://umc.pe.kr/
로그: 초기 PrivatePath = bin
로그: 동적 베이스 = NULL
로그: 캐시 베이스 = NULL
로그: AppName = iexplore.exe
호출 어셈블리: Infragistics2.Win.UltraWinGrid.v7.1, Version=7.1.20071.40, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb.
===
로그: 이 바인딩은 default 로드 컨텍스트에서 시작됩니다.
로그: 응용 프로그램 구성 파일이 없습니다.
로그: C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config에서 컴퓨터 구성 파일을 사용합니다.
로그: 바인딩했습니다. C:\Windows\assembly\GAC_MSIL\Infragistics2.Win.v7.1\7.1.20071.40__7dd5c3163f2cd0cb\Infragistics2.Win.v7.1.dll에서 어셈블리를 반환합니다.
오류: 어셈블리가 default 로드 컨텍스트에 로드되었습니다.
[바인딩 로그 1] Infragistic 컴포넌트가 GAC 에 등록되었을 때 바인딩 로그
 
*** Assembly Binder Log Entry (2007-09-19 @ 오후 11:57:54) ***
 
The operation was successful.
Bind result: hr = 0x0. 작업을 완료했습니다.
 
Assembly manager loaded from: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable C:\Program Files\Internet Explorer\IEXPLORE.EXE
--- A detailed error log follows.
 
=== Pre-bind state information ===
LOG: User = VPOWERUMCXP\엄준일
LOG: DisplayName = Infragistics2.Win.v7.1, Version=7.1.20071.40, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb
 (Fully-specified)
LOG: Appbase = http://umc.pe.kr/
LOG: Initial PrivatePath = bin
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = IEXPLORE.EXE
Calling assembly : Umc.PaintSmartClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: No application configuration file found.
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: Infragistics2.Win.v7.1, Version=7.1.20071.40, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb
LOG: GAC Lookup was unsuccessful.
LOG: Where-ref bind Codebase does not match what is found in default context. Keep the result in LoadFrom context.
LOG: Found assembly by looking in the download cache.
[바인딩 로그 2] Infragistic 컴포넌트가 GAC 에 등록되지 않았을 때 바인딩 로그
 
[바인딩 로그 1] 에서는 GAC 등록된 어셈블리를 로드 하였다. 참고로 GAC 에 등록된 어셈블리는 Windows폴더의 Assembly 안에서 확인할 수 있다. ( GACUTIL /L 과 동일 )
하지만, [바인딩 로그 2] 에서는 GAC 에서 찾지 못했다는 통보와 함께 다운로드 캐시에서 어셈블리를 찾았다는 로그를 남겨 놓는다.
 
그렇다면, 스마트클라이언트가 화면에 나타나기까지 동적인 업데이트(웹으로부터 업데이터)가 필요없는 어셈블리에 대해서 GAC 에 등록하는 것이 다운로드 속도를 증가하는 것을 알 수 있다.
 
그럼 이런 어셈블리는 어떻게 GAC 에 등록을 하면 될까~?
방법은 ClickOnce 를 통한 배포로 가능하다. ClickOnce 의 부트스트래퍼를 통해 필수구성요소로써 Infragistics 어셈블리를 배포하는 것이다. 하지만 이 내용은 이번 아티클에 포함하기엔 약간은 방대한 분량이라 다음 기회에 다시 다루어 볼 예정이다.
 
우연히 뎁질(데브피아 놀이) 하다가 팁으로 올리려다 이렇게 글이 길어지게 되었기에, 내일 아침도 뻐근한 목을 부등켜 잡고 출근해야 할 것 같다. 아훔 +_+
댓글