Microsoft MVP성태의 닷넷 이야기
오류 유형: 660. Web Deploy (msdeploy.axd) 실행 시 오류 기록 [링크 복사], [링크+제목 복사]
조회: 20500
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 

Web Deploy (msdeploy.axd) 실행 시 오류 기록

우선, IIS 웹 서버 측에 아무것도 설치되어 있지 않은 경우 비주얼 스튜디오에서 배포하면 다음과 같은 오류가 발생합니다.

Web deployment task failed. (Could not connect to the remote computer ("192.168.100.5"). On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started.  Learn more at: https://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE.)

This error indicates that you cannot connect to the server. Make sure the service URL is correct, firewall and network settings on this computer and on the server computer are configured properly, and the appropriate services have been started on the server.

Error details:
Could not connect to the remote computer ("192.168.100.5"). On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started.  Learn more at: https://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE.
Unable to connect to the remote server
No connection could be made because the target machine actively refused it 192.168.100.5:8172

당연히 해당 IIS 서버 측에 "Management Service" 구성 요소를 설치하고,

[Add Roles and Features]
Web Server (IIS)
    - Management Tools
        - Management Service

Web Deployment Tool 도구를 설치해야 합니다.

Configure the Web Deployment Handler
; https://learn.microsoft.com/en-us/iis/publish/using-web-deploy/configure-the-web-deployment-handler

Installing the Web Deployment Tool.
; https://learn.microsoft.com/en-us/iis/publish/using-web-deploy/use-the-web-deployment-tool

Web Deployment Tool
; https://www.iis.net/downloads/microsoft/web-deploy
; https://www.microsoft.com/en-us/download/details.aspx?id=43717

이후 서비스 관리자에서 2개의 서비스가 "Running" 상태인지를 확인합니다.

  • WMSvc - Web Management Service
  • MsDepSvc - Web Deployment Agent Service




그래도 다음과 같은 오류가 발생할 수 있습니다.

Web deployment task failed. (Connected to the remote computer ("192.168.100.5") using the specified process ("Web Management Service"), but could not verify the server’s certificate. If you trust the server, connect again and allow untrusted certificates.  Learn more at: https://go.microsoft.com/fwlink/?LinkId=221672#ERROR_CERTIFICATE_VALIDATION_FAILED.)

Connected to the remote computer ("192.168.100.5") using the specified process ("Web Management Service"), but could not verify the server’s certificate. If you trust the server, connect again and allow untrusted certificates.  Learn more at: https://go.microsoft.com/fwlink/?LinkId=221672#ERROR_CERTIFICATE_VALIDATION_FAILED.
The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
The remote certificate is invalid according to the validation procedure.

이런 경우엔 차라리 비주얼 스튜디오 측의 배포 대화창에서 "Edit"로 들어가,

iis_dep_error_1.png

UI 상에서 "Validate Connection" 버튼을 눌러 뜨는 오류 창에서 "Save this certificate for future sessions of Visual Studio" 옵션을 체크한 후 "Accept"를 선택하면 인증서를 신뢰합니다.




또는, 403 Forbidden 오류가 발생할 수도 있습니다.

Web deployment task failed. (Could not connect to the remote computer ("192.168.100.5") using the specified process ("Web Management Service") because the server did not respond. Make sure that the process ("Web Management Service") is started on the remote computer.  Learn more at: https://go.microsoft.com/fwlink/?LinkId=221672#ERROR_COULD_NOT_CONNECT_TO_REMOTESVC.)

Could not connect to the remote computer ("192.168.100.5") using the specified process ("Web Management Service") because the server did not respond. Make sure that the process ("Web Management Service") is started on the remote computer.  Learn more at: https://go.microsoft.com/fwlink/?LinkId=221672#ERROR_COULD_NOT_CONNECT_TO_REMOTESVC.
The remote server returned an error: (403) Forbidden.

이럴 때는, 서비스 관리자에서 "WMSVC(Web Management Service)"를 중지 시킨 후, IIS 관리자에서 (컴퓨터 이름이 출력되는) 서버 노드의 "Management Service"로 들어가 "Enable remote connections"를 활성화하고,

iis_dep_error_2.png

다시 WMSVC를 시작하면 됩니다.




그래도 404 Not Found 오류가 발생한다면?

Web deployment task failed. (Could not connect to the remote computer ("192.168.100.5"). On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started.  Learn more at: https://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE.)
The requested resource does not exist, or the requested URL is incorrect.

Could not connect to the remote computer ("192.168.100.5"). On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started.  Learn more at: https://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE.
The remote server returned an error: (404) Not Found.

WMSVC의 로그가 남는 디렉터리에(기본값으로 %SystemDrive%\Inetpub\logs\WMSvc) 가보면 보다 구체적인 substatus 코드를 알 수 있습니다.

#Software: Microsoft Internet Information Services 10.0
#Version: 1.0
#Date: 2020-09-29 05:47:43
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken
2020-09-29 05:47:43 192.168.100.5 HEAD /msdeploy.axd site=Blazor2 8172 - 192.168.0.19 - - 404 7 0 1062
2020-09-29 05:47:44 192.168.100.5 HEAD /msdeploy.axd site=Blazor2 8172 - 192.168.0.19 - - 404 7 0 0
2020-09-29 05:47:44 192.168.100.5 HEAD /msdeploy.axd site=Blazor2 8172 - 192.168.0.19 - - 404 7 0 15

위에서는 "404.7"로 "File Extension Denied"를 의미하는데요, 시스템에 "AXD-ISAPI-4.0_32bit" / "AXD-ISAPI-4.0_64bit"라는 이름의 핸들러(*.axd) 매핑이 없기 때문입니다.

직접 구성해도 되지만, 그냥 이런 경우에는 "Web Deploy" 도구를 제거하고 다시 설치할 때 다음과 같이 "IIS Deployment Handler"와 "Remote Agent Service"를 명시적으로 체크해 진행하면 됩니다.

iis_dep_error_3.png




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







[최초 등록일: ]
[최종 수정일: 3/9/2024]

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

비밀번호

댓글 작성자
 



2021-06-23 03시43분
Locked Files When Publishing .NET Core Apps to IIS with WebDeploy
; https://weblog.west-wind.com/posts/2021/Jun/20/Locked-Files-When-Publishing-NET-Core-Apps-to-IIS-with-WebDeploy

app_offline.htm
<EnableMSDeployAppOffline>true</EnableMSDeployAppOffline>
정성태

... 16  [17]  18  19  20  21  22  23  24  25  26  27  28  29  30  ...
NoWriterDateCnt.TitleFile(s)
13197정성태12/17/20224309.NET Framework: 2079. .NET Core/5+ 환경에서 XmlSerializer 사용 시 System.IO.FileNotFoundException 예외 발생하는 경우파일 다운로드1
13196정성태12/16/20224428.NET Framework: 2078. .NET Core/5+를 위한 SGen(Microsoft.XmlSerializer.Generator) 사용법
13195정성태12/15/20224993개발 환경 구성: 655. docker - bridge 네트워크 모드에서 컨테이너 간 통신 시 --link 옵션 권장 이유
13194정성태12/14/20225047오류 유형: 833. warning C4747: Calling managed 'DllMain': Managed code may not be run under loader lock파일 다운로드1
13193정성태12/14/20225091오류 유형: 832. error C7681: two-phase name lookup is not supported for C++/CLI or C++/CX; use /Zc:twoPhase-
13192정성태12/13/20225103Linux: 55. 리눅스 - bash shell에서 실수 연산
13191정성태12/11/20226002.NET Framework: 2077. C# - 직접 만들어 보는 SynchronizationContext파일 다운로드1
13190정성태12/9/20226482.NET Framework: 2076. C# - SynchronizationContext 기본 사용법파일 다운로드1
13189정성태12/9/20227122오류 유형: 831. Visual Studio - Windows Forms 디자이너의 도구 상자에 컨트롤이 보이지 않는 문제
13188정성태12/9/20225948.NET Framework: 2075. C# - 직접 만들어 보는 TaskScheduler 실습 (SingleThreadTaskScheduler)파일 다운로드1
13187정성태12/8/20225849개발 환경 구성: 654. openssl - CA로부터 인증받은 새로운 인증서를 생성하는 방법 (2)
13186정성태12/6/20224373오류 유형: 831. The framework 'Microsoft.AspNetCore.App', version '...' was not found.
13185정성태12/6/20225368개발 환경 구성: 653. Windows 환경에서의 Hello World x64 어셈블리 예제 (NASM 버전)
13184정성태12/5/20224657개발 환경 구성: 652. ml64.exe와 link.exe x64 실행 환경 구성
13183정성태12/4/20224501오류 유형: 830. MASM + CRT 함수를 사용하는 경우 발생하는 컴파일 오류 정리
13182정성태12/4/20225214Windows: 217. Windows 환경에서의 Hello World x64 어셈블리 예제 (MASM 버전)
13181정성태12/3/20224616Linux: 54. 리눅스/WSL - hello world 어셈블리 코드 x86/x64 (nasm)
13180정성태12/2/20224842.NET Framework: 2074. C# - 스택 메모리에 대한 여유 공간 확인하는 방법파일 다운로드1
13179정성태12/2/20224263Windows: 216. Windows 11 - 22H2 업데이트 이후 Terminal 대신 cmd 창이 뜨는 경우
13178정성태12/1/20224748Windows: 215. Win32 API 금지된 함수 - IsBadXxxPtr 유의 함수들이 안전하지 않은 이유파일 다운로드1
13177정성태11/30/20225464오류 유형: 829. uwsgi 설치 시 fatal error: Python.h: No such file or directory
13176정성태11/29/20224401오류 유형: 828. gunicorn - ModuleNotFoundError: No module named 'flask'
13175정성태11/29/20225970오류 유형: 827. Python - ImportError: cannot import name 'html5lib' from 'pip._vendor'
13174정성태11/28/20224578.NET Framework: 2073. C# - VMMap처럼 스택 메모리의 reserve/guard/commit 상태 출력파일 다운로드1
13173정성태11/27/20225257.NET Framework: 2072. 닷넷 응용 프로그램의 스레드 스택 크기 변경
13172정성태11/25/20225122.NET Framework: 2071. 닷넷에서 ESP/RSP 레지스터 값을 구하는 방법파일 다운로드1
... 16  [17]  18  19  20  21  22  23  24  25  26  27  28  29  30  ...