성태의 닷넷 이야기
홈 주인
모아 놓은 자료
프로그래밍
질문/답변
사용자 관리
사용자
메뉴
아티클
외부 아티클
유용한 코드
온라인 기능
MathJax 입력기
최근 덧글
[정성태] Detecting blocking calls using asyn...
[정성태] 아쉽게도, 커뮤니티는 아니고 개인 블로그입니다. ^^
[정성태] 질문이 잘 이해가 안 됩니다. 우선, 해당 소스코드에서 ILis...
[양승조
] var대신 dinamic으로 선언해서 해결은 했습니다. 맞는 해...
[양승조
] 또 막혔습니다. ㅠㅠ var list = props[i].Ge...
[양승조
] 아. 감사합니다. 어제는 안됐던것 같은데....정신을 차려야겠네...
[정성태] "props[i].GetValue(props[i])" 코드에서 ...
[정성태] 저렇게 조각 코드 말고, 실제로 재현이 되는 예제 프로젝트를 압...
[정성태] Modules 창(Ctrl+Shift+U)을 띄워서, 해당 Op...
[정성태] 만드실 수 있습니다. 단지, Unity 엔진 내의 스크립트와 W...
글쓰기
제목
이름
암호
전자우편
HTML
홈페이지
유형
제니퍼 .NET
닷넷
COM 개체 관련
스크립트
VC++
VS.NET IDE
Windows
Team Foundation Server
디버깅 기술
오류 유형
개발 환경 구성
웹
기타
Linux
Java
DDK
Math
Phone
Graphics
사물인터넷
부모글 보이기/감추기
내용
<div style='display: inline'> <h1 style='font-family: Malgun Gothic, Consolas; font-size: 20pt; color: #006699; text-align: center; font-weight: bold'>Visual Studio - 32비트로만 빌드된 ActiveX와 작업해야 한다면?</h1> <p> Visual Studio 2022에서 Toolbox의 "Choose items..." 메뉴를 통해 "COM Components" 목록을 보면 모두 64비트 COM 개체만 있습니다. 설령 "Browse" 버튼을 눌러 32비트 COM 개체를 선택한다 해도 다음과 같이 오류가 발생합니다.<br /> <br /> <img alt='ax32_reg_failed_1.png' src='/SysWebRes/bbs/ax32_reg_failed_1.png' /><br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > Self-registration for C:\...\ATLProject1.dll failed. </pre> <br /> 보는 바와 같이, 목록에 있는 COM 개체들은 모두 64비트 경로에 해당하는 것들만 있습니다. 왜냐하면, Visual Studio 2022가 64비트 프로세스이기 때문에 32비트 DLL을 로딩할 수 없는 것입니다. 이와 관련해 예전에도 Windows Forms Designer에서 유사한 문제가 있는 것을 소개한 적이 있습니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > Visual Studio 2022 - Windows Forms 프로젝트의 x86 DLL 컨트롤이 Designer에서 오류가 발생하는 문제 ; <a target='tab' href='https://www.sysnet.pe.kr/2/0/12683'>https://www.sysnet.pe.kr/2/0/12683</a> </pre> <br /> 그때도 언급했지만, 사실 <a target='tab' href='https://www.sysnet.pe.kr/2/0/12602'>이건 반대의 상황에서도 그대로 나옵니다</a>. (32비트 프로세스인) Visual Studio 2019 이하의 버전에서 위와 동일하게 64비트 COM DLL을 등록하려고 하면 다음과 같이 동일한 오류가 발생합니다.<br /> <br /> <img alt='ax32_reg_failed_2.png' src='/SysWebRes/bbs/ax32_reg_failed_2.png' /><br /> <br /> 그리고 목록에 나온 항목들이 모두 32비트 경로에 위치하고 있는 것을 볼 수 있습니다.<br /> <br /> <hr style='width: 50%' /><br /> <br /> 따라서, 만약 Visual Studio 2022에서 32비트 COM 개체를 사용해야 한다면 2022를 포기하고 2019로 작업해야 합니다. 혹은, 해당 COM 개체를 하루빨리 64비트로 포팅하는 수밖에는 없습니다.<br /> <br /> 이에 대해서는 다음의 이슈에 이미 논란이 되고 있었는데요,<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > WinForms .NET Framework Projects can't display the designer for 32bit references ; <a target='tab' href='https://developercommunity.visualstudio.com/t/WinForms-NET-Framework-Projects-cant-d/1601210'>https://developercommunity.visualstudio.com/t/WinForms-NET-Framework-Projects-cant-d/1601210</a> </pre> <br /> 2021년 12월에 생성된 이슈가 2023년 4월까지 해결되지 않고 있으니 아마도 앞으로도 진전은 없을 듯합니다. 실제로 "<a target='tab' href='https://developercommunity.visualstudio.com/t/WinForms-NET-Framework-Projects-cant-d/1601210#T-N1601090'>Merrie McGaw [MSFT]"</a>의 답변을 봐도, 다음과 같은 우회 방법만을 알려주고 있습니다.<br /> <br /> <ul> <li>You can simply keep using Visual Studio 2019 for forms that have references to 32-bit components until we add support for .NET Framework projects to the out of process designer.</li> <li>If you are an author of the component you are using, rebuild it for ‘x64’ for native components or ‘Any CPU’ for managed code. For managed code, the procedure should be very straight forward.</li> <li>If a 32-bit component cannot be rebuilt, you can create a “design” configuration of the project, which targets 64-bits and where the 32-bit component is replaced with a 64-bit placeholder. This particular component will not be available at design time but the rest of the UI will be.</li> <li>If you are using a third-party component, reach out to the author and ask them to provide an ‘x64’ or ‘Any CPU’-version of it.</li> <li>For some cases, such as Visual Basic 6, producing 64-bit is not an option because they are legacy controls that don’t have an implementation on 64-bit CPU. We would suggest finding a .NET substitute for the component that provides similar functionality.</li> </ul> <br /> <hr style='width: 50%' /><br /> <br /> 참고로, 2022에서 32비트 DLL을 선택해도 정상적으로 등록되는 것처럼 보이는 경우, 또는 그 반대로 2019에서 64비트 DLL을 선택해도 되는 것처럼 동작하는 경우가 있는데요, 그것은 해당 DLL이 32비트/64비트 모두 등록된 상황이기 때문에 비주얼 스튜디오가 적절한 플랫폼의 DLL을 대신 선택해 주는 것뿐입니다.<br /> </p><br /> <br /><hr /><span style='color: Maroon'>[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]</span> </div>
첨부파일
스팸 방지용 인증 번호
1382
(왼쪽의 숫자를 입력해야 합니다.)