"IIS Express 웹 서버를 시작할 수 없습니다." Visual Studio에서
Visual Studio를 통해 웹 서비스를 실행하려고했습니다. 다음과 같은 문제에 직면했습니다.
---------------------------
Microsoft Visual Studio
---------------------------
Unable to launch the IIS Express Web server.
Failed to register URL "http://localhost:63591/" for site "xxxxxx" application
"/". Error description: The process cannot access the file because it is being
used by another process. (0x80070020)
---------------------------
OK
---------------------------
작업 관리자를보고 시스템에서 PID 4를 사용하고 설명이라는 것을 발견했습니다. NT Kernel & System.
그래서 http service
. 모든 종속성 서비스가 중지되었습니다. 하지만 http 서비스를 중지하는 데 문제가 있습니다.
The service is starting or stopping. Please try again later.
그래서 수동으로 서비스를 중지하고 시작하려고했습니다. 그러나 종료 프로세스는 비활성화됩니다. 누구든지이 문제를 도울 수 있다면 도움이 될 것입니다.
에서 https://www.davidsalter.co.uk/unable-to-launch-the-iis-express-web-server-error-0x80070020/
오류 코드 0x80070020
는를 의미하며 ERROR_SHARING_VIOLATION
, IIS Express (또는 IIS)의 경우 수신하려는 포트가 다른 프로세스에서 사용 중임을 의미합니다.
사용 netstat
포트를 사용하고있는 응용 프로그램을 찾아 명령을 사용합니다.
netstat -ao | findstr <port_number_to_search_for>
이 a
매개 변수는 netstat에 모든 연결 및 수신 포트를 표시하도록 지시합니다.
이 o
매개 변수는 netstat에 연결과 관련된 프로세스 ID를 표시하도록 지시합니다.
위의 netstat 명령을 실행하면 다음과 같은 출력이 생성됩니다.
C:\>netstat -ao | findstr 4026
TCP 12.0.0.1:4026 cs-pc:4026 LISTENING 9544
표시된 마지막 숫자 (여기서는 9544)가 프로세스 ID입니다.
나는 같은 문제가 있었다. 방금 Visual Studio를 다시 시작했는데 작동했습니다.
나는 같은 문제가 있었다. @Kautsky Lozano가 위에서 언급했듯이 다른 응용 프로그램이 해당 포트를 사용하고 있습니다.
따라서 [Windows OS의 경우] 다음과 같습니다.
- 리소스 모니터 열기 (작업 관리자-> 성능-> 리소스 모니터 열기)
- 네트워크 탭을 클릭 하십시오.
- 그리고 TCP 연결 에서 IIS Express가 사용하는 로컬 포트를 사용하는 응용 프로그램을 찾아서 닫습니다. (제 경우에는 firefox였습니다)
Visual Studio 2012에서 2015로 솔루션을 업그레이드 한 후에도 동일한 문제가 발생했습니다. 여기에 와서 netstat
다른 응용 프로그램이 동일한 포트를 사용하지 않는 것을 확인하기 위해 실행했습니다 . 내가 동일하게 매핑 포트와 같은 사이트했다 밝혀 applicationhost.config
에서 Users/<username>/Documents/IISExpress/config
와 applicationhost.config
에서 .vs
폴더 내 솔루션 내부. 업그레이드 직후에도 문제가 시작되지 않았습니다. 어느 날 아침 일관되게 실패하기 시작합니다. 몇 번의 재부팅으로도 문제가 해결되지 않는 것 같습니다.
내 문서에 저장된 사이트에서 충돌하는 사이트를 제거하고 Visual Studio를 다시 시작하면 문제가 해결되었습니다.
다른 응용 프로그램이 해당 포트를 사용하고 있습니다. 이것은 당신을 도울 수 있습니다
MVC 프로젝트를 업그레이드 할 때이 문제가 발생 했습니다 . 기존 .csproj 파일 위에 최신 MVC .csproj를 복사 한 다음 완전히 작동하는 프로젝트로 다시 작업했습니다. 내가 고려하지 못한 것은 이전 .csproj의 기존 포트 번호입니다. 새 프로젝트에는 새 포트 번호가 있지만 프로젝트 / 어셈블리 이름을 공유했습니다. 이는 IIS Express가 정신을 잃고이 예외를 던지기에 충분했습니다.
git에서 이전 포트 번호를 찾아서 프로젝트 설정에 포함하도록 IIS Express URL을 변경하는 것만으로도 충분했습니다.
명령 콘솔에 들어 가지 않고 가장 쉬운 첫 번째 단계는 모든 응용 프로그램 (VS 포함)을 종료 한 다음 VS를 자체적으로 시작하고 다시 시도하는 것입니다. 충돌을 일으키는 브라우저와 같은 다른 응용 프로그램이있을 수 있습니다. 제 경우에는 Chrome이 문제를 일으키고 모든 것을 종료하고 VS를 다시 시작할 때 해결되었습니다. Chrome을 다시 열었고 모든 것이 정상이었습니다.
위의 netstat 항목은 유용하지만 제게는 제가 제안한 것을 할 수없는 경우에만 그렇습니다.
모든 답변을 요약합니다. 두 가지 해결책이 있습니다. 둘 다 나를 위해 일했습니다. - 해결 방법 # 1 동일한 포트를 사용하는 앱을 종료합니다. - 솔루션 # 2 프로젝트에 다른 포트를 사용하도록 IIS Express를 구성합니다.
솔루션 # 1 (오류 메시지의 포트가 443이라고 가정) 명령 줄에서 실행합니다.
netstat -ao | findstr 443
반환 : TCP 0.0.0.0:443 pe01:0 LISTENING 2904
마지막 숫자 (@ chris-schiffhauer 덕분에)는 죽일 PID입니다. 작업 관리자-> 프로세스-> [모든 사용자의 프로세스 표시]로 이동하여 PID = 2904로 프로세스를 종료합니다. 제 경우에는 VmWare 호스트였습니다.
해결 방법 # 2 (메시지 가정 : "MyProject.Website0"사이트에 대한 URL " http : // localhost : 433 / "을 ( 를) 등록하지 못했습니다 ... ). notepad ++에서 다음 파일을 엽니 다. 다음을 C:\Users\MY_USER_NAME\Documents\IISExpress\config\applicationhost.config
포함하는 줄을 찾습니다.
<site name="MyProject.Website0" id="...
...
<bindings>
<binding protocol="http" bindingInformation="*:80:localhost" />
<binding protocol="https" bindingInformation="*:443:localhost" />
</bindings>
433
다른 것으로 변경 4330
하거나 충돌하는 <binding.../>
태그를 삭제하십시오 .
Web Project Properties >> Web >> Project Url >> Change port ie : http : // localhost : 22345 / => http : // localhost : 22346 /로 이동 하십시오.
I just had this issue even though netstat did not show any conflicts.
The following fixed it for me:
- Close Visual Studio
- Open up File Explorer
- Navigate to the folder of the offending project
- Delete the obj and bin folders
- Delete the *.user file (this is probably optional)
- Restart Visual Studio and try again
In my case, doing the following did the trick:
- Delete the Site from .vs\\config\applicationhost.config
- Delete the Site from Documents\IISExpress\config\applicationhost.config
- Delete the IISUrl from the .csproj
When I restarted Visual Studio, it assigned the project a completely new port number and ran perfectly
I tried the following already:
- Restarted Visual Studio
- Check all available ports that might be listening to my specific number but it always return zero results. No processes is listening in my port.
I also tried using this but zero results.
netstat -aon | find ":80"
I also tried using but also return zero results.
netstat -ao | findstr
So what I did is delete this "Microsoft.VsHub.Server.HttpHostx64.exe" then my project successfully started and launch in browser. The error was fixed. I am not sure why but it works.
Here is the screenshot:
I was able fix this problem by removing everything from <site>
to </site>
tags in
Users/<username>/Documents/IISExpress/config/applicatiohost.config
file
<sites>
<site>
.
. ===> remove this content including the <site> and </site> tags.
.
</site>
</sites>
Having just wasted half a day trying to fix this same issue, I felt I should add the solution which eventually worked for me.
TL;DR If netstat
indicates that the problematic isn't in use, still try a few others in a totally different range
I've run into this problem before but usually find restarting visual studio, changing ports (increment by 1) or rebooting do the trick. However on this occasion none of this helped, and netstat
wasn't finding a conflicting process. I even reinstalled IIS and visual studio and removed several other programs which I suspected could be interfering. It seemed as though IIS was trying to launch multiple instances of the same site.
Eventually I tried running netstat
without findstr
. I visually scanned the list of active ports and noticed that although the ones I had tried were not listed, there were a few processes using ports in a similar range. So instead I looked for a range which was free, picked a port number and that seems to now be working.
I'd love to hear if anybody can explain why this might have worked?
Port numbers do not match
In my case the problem was in my Bindings Tags found in the config file in .vs under my solution folder, the port numbers did not match. The bindings were as follows
<bindings>
<binding protocol="http" bindingInformation=":16433:localhost" />
</bindings>
And in my settings i had url set as http://localhost:1943/
So what i did was to delete inside binding and run my web app, then it generated new binding with a different number then i copied the new generated port to my settings, then the error went away.
'Development Tip' 카테고리의 다른 글
슬러그에 의한 WordPress 쿼리 단일 게시물 (0) | 2020.11.03 |
---|---|
자바 스크립트 확장 클래스 (0) | 2020.11.03 |
.NET 소스 코드가 디버깅 중단 점을 하드 코딩 할 수 있습니까? (0) | 2020.11.03 |
Java 맵 항목 업데이트 (0) | 2020.11.03 |
Perl : if (목록의 요소) (0) | 2020.11.03 |