Microsoft MVP성태의 닷넷 이야기
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 


PFX 코드 서명을 포함한 프로젝트의 팀 빌드 실패 - MSB4018


주로 ClickOnce 프로젝트에서 발생할 수 있는 문제인데요.

테스트를 위한 목적으로 "Self-signed" 유형의 인증서를 사용하는 것과는 달리, 아래의 화면과 같이 인증 기관으로부터 발급받은 인증서를 사용하는 경우에,

[그림 1: 인증서]
tfs_build_error_sign_with_pfx_1.PNG

방법이 크게 2가지로 나뉩니다.

  • 인증서 보관소에서 선택하는 방법
  • 내보내기된 pfx를 사용하는 방법

해보신 분들은 아시겠지만, 인증서 보관소에서 선택하는 경우에는 인증서를 설치하는 과정에서 이미 한번 비밀번호를 입력하기 때문에 빌드 시에 아무런 동작이 없지만, pfx를 직접 프로젝트에 포함해서 선택한 경우에는 빌드 시에 아래와 같이 pfx에 대한 비밀번호를 입력하는 대화창이 뜹니다.

[그림 2: 빌드 시 인증서 암호 요구]
tfs_build_error_sign_with_pfx_2.PNG

다행스러운 것은, 이때 요구된 비밀번호는 cache되어 이후의 빌드에서는 다시 묻지 않습니다.




위와 같이 pfx를 포함한 프로젝트를 팀 빌드하면 다음과 같은 오류가 발생합니다.

error MSB4018: The "ResolveKeySource" task failed unexpectedly.
System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
   at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   at System.Windows.Forms.Form.ShowDialog()
   at Microsoft.Build.Tasks.ResolveKeySource.ResolveManifestKey()
   at Microsoft.Build.Tasks.ResolveKeySource.Execute()
   at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult)

원인을 아시겠지요? ^^
역시나 팀 빌드에서도 빌드 도중에 pfx 암호를 요구하는 대화창을 띄웠고, 이것이 "UserInteractive"로 동작하지 않고 있는 NT 서비스 하에서 실행되었기 때문에 위와 같은 오류가 발생한 것입니다. 그렇다면, 해결책도 간단하겠군요.

NT 서비스를 구동시키는 계정(예를 들어, Domain\TFSService)으로 팀 빌드가 실행되는 컴퓨터에 로그인을 한 후, Visual Studio를 띄우거나 명령행에서 MSBuild를 이용하여 pfx를 포함한 프로젝트를 빌드합니다. 그럼, 도중에 "[그림 2]"에서 보여진 대화창이 뜨고 역시 비밀번호를 입력하면 해당 계정(Domain\TFSService)에 cache됩니다.

자! 이제 ^^ 팀 빌드를 구동시키면 cache된 비밀번호 정보가 있기 때문에 팀빌드가 성공합니다. 끝!



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







[최초 등록일: ]
[최종 수정일: 4/10/2022]

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

비밀번호

댓글 작성자
 




... 106  107  108  109  110  111  112  113  114  115  116  117  [118]  119  120  ...
NoWriterDateCnt.TitleFile(s)
11035정성태8/29/201622540오류 유형: 354. .NET Reflector - PDB 생성 화면에서 "Clear Store"를 하면 "Index and length must refer to a location within the string" 예외 발생
11034정성태8/25/201626602개발 환경 구성: 296. .NET Core 프로젝트를 NuGet Gallery에 배포하는 방법 [2]
11033정성태8/24/201624657오류 유형: 353. coreclr 빌드 시 error C3249: illegal statement or sub-expression for 'constexpr' function
11032정성태8/23/201623838개발 환경 구성: 295. 최신의 Visual C++ 컴파일러 도구를 사용하는 방법 [1]
11031정성태8/23/201619684오류 유형: 352. Error encountered while pushing to the remote repository: Response status code does not indicate success: 403 (Forbidden).
11030정성태8/23/201623283VS.NET IDE: 111. Team Explorer - 추가한 Git Remote 저장소가 Branch에 보이지 않는 경우
11029정성태8/18/201630689.NET Framework: 602. Process.Start의 cmd.exe에서 stdin만 redirect 하는 방법 [1]파일 다운로드1
11028정성태8/15/201623117오류 유형: 351. Octave 설치 시 JRE 경로 문제
11027정성태8/15/201625294.NET Framework: 601. ElementHost 컨트롤의 메모리 누수 현상
11026정성태8/13/201626479Math: 19. 행렬 연산으로 본 해밍코드
11025정성태8/12/201625781개발 환경 구성: 294. .NET Core 프로젝트에서 "Copy to Output Directory" 처리 [1]
11024정성태8/12/201624489오류 유형: 350. "nProtect GameMon" 실행 중에는 Visual Studio 디버깅이 안됩니다! [1]
11023정성태8/10/201626029개발 환경 구성: 293. Azure 구독 후 PaaS 서비스 만들어 보기
11022정성태8/10/201626864개발 환경 구성: 292. Azure Cloud Service 배포시 사용자 정의 작업을 추가하는 방법
11021정성태8/10/201624012오류 유형: 349. System.Runtime.Remoting.RemotingException - Type '..., ..., Version=..., Culture=neutral, PublicKeyToken=null' is not registered for activation [2]
11020정성태8/10/201626830VC++: 98. 원본과 대상 버퍼가 같은 경우 memcpy, wmemcpy 주의점
11019정성태8/10/201643587기타: 60. 도서: 시작하세요! C# 6.0 프로그래밍: 기본 문법부터 실전 예제까지 (2쇄 정오표)
11018정성태8/9/201627551.NET Framework: 600. 단일 메서드 내에서의 할당으로 알아보는 자바와 닷넷의 GC 차이점 [1]
11017정성태8/9/201628315웹: 33. HTTP 쿠키에 한글 값을 설정하는 방법
11016정성태8/7/201626941개발 환경 구성: 291. Windows Server Containers 소개
11015정성태8/7/201625352오류 유형: 348. Windows Server 2016 TP5에서 Windows Containers의 docker run 실행 시 encountered an error during Start failed in Win32
11014정성태8/6/201625913오류 유형: 347. Hyper-V Virtual Machine Management service Account does not have permission to open attachment
11013정성태8/6/201636780개발 환경 구성: 290. Windows 10에서 경험해 보는 Windows Containers와 docker [4]
11012정성태8/6/201626952오류 유형: 346. Windows 10에서 Windows Containers의 docker run 실행 시 encountered an error during CreateContainer failed in Win32 발생
11011정성태8/6/201628157기타: 59. outlook.live.com 메일 서비스의 아웃룩 POP3 설정하는 방법
11010정성태8/6/201624940기타: 58. Outlook에 설정한 SMTP/POP3(예:천리안 메일) 계정 암호를 잊어버린 경우
... 106  107  108  109  110  111  112  113  114  115  116  117  [118]  119  120  ...