Microsoft MVP성태의 닷넷 이야기
VS.NET IDE: 73. Visual Studio 2012 - XmlCodeGenerator 마이그레이션 [링크 복사], [링크+제목 복사],
조회: 26572
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 
(연관된 글이 1개 있습니다.)

Visual Studio 2012 - XmlCodeGenerator 마이그레이션

Visual Studio에는 "Custom Tool" 기능이 제공되고 있는데요.

Registering Single File Generators
; https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2015/extensibility/internals/registering-single-file-generators

저도 위의 기능을 이용하여 간단하게 다음의 도구를 만들었습니다.

XmlCodeGenerator 1.0.0.4 업데이트
; https://www.sysnet.pe.kr/2/0/760

그런데, 이것을 Visual Studio 2012로 마이그레이션 하는 과정에서 애를 좀 먹었습니다.

"Registering Single File Generators" 글에서도 설명된 것처럼 IVsSingleFileGenerator 유의 소스 코드 생성기는 "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio" 레지스트리 위치에 버전별로 등록하도록 되어 있는데요. 제가 만든 XmlCodeGenerator의 경우 정상적으로 그 위치에 등록되었음에도 불구하고 2012에서는 동작을 하지 않았습니다.

이유를 찾기 위해, "Process Monitor"로 살펴보아야만 했는데요. 보시는 것처럼, 전혀 엉뚱한 위치에서 plug-in DLL을 찾는 것을 볼 수 있습니다.

codegen_vs2012_1.png

HKCU\Software\Microsoft\VisualStudio\11.0_Config\Generators\{FAE04EC1-301F-11D3-BF4B-00C04F79EFBC}\XmlCodeGenerator


여기서 재미있는 점이 하나 있는데요. 기존 Visual Studio 2010에서도 역시 HKCU 위치의 레지스트리에서 plug-in을 찾는 것이었습니다. 그런데 왜? HKLM 측에 등록해도 동작이 되었냐면, Visual Studio 2010은 plug-in이 HKLM에 등록되어 있으면 실행 시에 HKCU 측으로 복사를 해주기 때문입니다. (문서에서 본 내용은 아니고, 직접 눈으로 확인한 것입니다.)

즉, Visual Studio 2012는 그 복사 과정을 해주지 않기 때문에 동작하지 않았던 것입니다.

할 수 없군요. ^^ 등록해 주는 코드를 작성해 주는 수밖에.

string visualStudioRegKeys = @"Software\Microsoft\VisualStudio\11.0_Config\Generators\{FAE04EC1-301F-11D3-BF4B-00C04F79EFBC}";

using (RegistryKey key = Registry.CurrentUser.OpenSubKey(visualStudioRegKeys, true))
{
    using (RegistryKey pluginKey = key.CreateSubKey("XmlCodeGenerator"))
    {
        pluginKey.SetValue(string.Empty, "BclExtension.XmlCodeGenerator");
        pluginKey.SetValue("CLSID", "{" + RefGuid + "}");
        pluginKey.SetValue("GeneratesDesignTimeSource", 0, RegistryValueKind.DWord);
    }
}

이를 반영하여 현재 "DeveloperToolManager"도 업데이트 시켰고, 그것을 통해서 정상적으로 등록까지 완료됩니다.




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]

[연관 글]






[최초 등록일: ]
[최종 수정일: 6/27/2021]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




... 121  122  123  124  125  126  127  128  129  [130]  131  132  133  134  135  ...
NoWriterDateCnt.TitleFile(s)
1806정성태11/10/201425137.NET Framework: 477. SeCreateGlobalPrivilege 특권과 WCF NamedPipe
1805정성태11/5/201421998.NET Framework: 476. Visual Studio에서 Mono용 Profiler 개발 [3]파일 다운로드1
1804정성태11/5/201428253.NET Framework: 475. ETW(Event Tracing for Windows)를 C#에서 사용하는 방법 [9]파일 다운로드1
1803정성태11/4/201420346오류 유형: 261. Windows Server Backup 오류 - Error in backup of E:\$Extend\$RmMetadata\$TxfLog
1802정성태11/4/201422274오류 유형: 260. 이벤트 로그 - Windows Error Reporting / AEAPPINVW8
1801정성태11/4/201427611오류 유형: 259. 이벤트 로그 - Windows Error Reporting / IPX Assertion / KorIME.exe [1]
1800정성태11/4/201418268오류 유형: 258. 이벤트 로그 - Starting a SMART disk polling operation in Automatic mode.
1799정성태11/4/201423070오류 유형: 257. 이벤트 로그 - The WMI Performance Adapter service entered the stopped state.
1798정성태11/4/201431861오류 유형: 256. 이벤트 로그 - The WinHTTP Web Proxy Auto-Discovery Service service entered the stopped state. [1]
1797정성태11/4/201417580오류 유형: 255. 이벤트 로그 - The Adobe Flash Player Update Service service entered the stopped state.
1796정성태10/30/201424547개발 환경 구성: 249. Visual Studio 2013에서 Mono 컴파일하는 방법
1795정성태10/29/201427081개발 환경 구성: 248. Lync 2013 서버 설치 방법
1794정성태10/29/201422503개발 환경 구성: 247. "Microsoft Office 365 Enterprise E3" 서비스에 대한 간략 소개
1793정성태10/27/201423160.NET Framework: 474. C# - chromiumembedded 사용 - 두 번째 이야기 [2]파일 다운로드1
1792정성태10/27/201423286.NET Framework: 473. WebClient 객체에 쿠키(Cookie)를 사용하는 방법
1791정성태10/22/201423010VC++: 83. G++ - 템플릿 클래스의 iterator 코드 사용에서 발생하는 컴파일 오류 [5]
1790정성태10/22/201418537오류 유형: 254. NETLOGON Service is paused on [... AD Server...]
1789정성태10/22/201421212오류 유형: 253. 이벤트 로그 - The client-side extension could not remove user policy settings for '...'
1788정성태10/22/201423239VC++: 82. COM 프로그래밍에서 HRESULT 타입의 S_FALSE는 실패일까요? 성공일까요? [2]
1787정성태10/22/201431407오류 유형: 252. COM 개체 등록시 0x8002801C 오류가 발생한다면?
1786정성태10/22/201432733디버깅 기술: 65. 프로세스 비정상 종료 시 "Debug Diagnostic Tool"를 이용해 덤프를 남기는 방법 [3]파일 다운로드1
1785정성태10/22/201421943오류 유형: 251. 이벤트 로그 - Load control template file /_controltemplates/TaxonomyPicker.ascx failed [1]
1784정성태10/22/201430028.NET Framework: 472. C/C++과 C# 사이의 메모리 할당/해제 방법파일 다운로드1
1783정성태10/21/201423493VC++: 81. 프로그래밍에서 borrowing의 개념
1782정성태10/21/201420219오류 유형: 250. 이벤트 로그 - Application Server job failed for service instance Microsoft.Office.Server.Search.Administration.SearchServiceInstance
1781정성태10/21/201420677디버깅 기술: 64. new/delete의 짝이 맞는 경우에도 메모리 누수가 발생한다면?
... 121  122  123  124  125  126  127  128  129  [130]  131  132  133  134  135  ...