Microsoft MVP성태의 닷넷 이야기
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 
(연관된 글이 2개 있습니다.)

"ASP.NET Core Web Application (.NET Core)"와 "ASP.NET Core Web Application (.NET Framework)" 차이점

아래의 질문/답변에도 있군요. ^^

Difference between using the ASP.NET Core Web Application (.NET Core) with net461 set as the only framework and using the (.NET Framework) template
; http://stackoverflow.com/questions/37452041/difference-between-using-the-asp-net-core-web-application-net-core-with-net46

정리해 보면, 그 둘간의 차이는 project.json의 설정에 기인한 것이고, 그에 따라 말 그대로 기반 프레임워크가 ".NET Core"냐 ".NET Framework"에 따른 차이일 뿐입니다.

쉽게 생각해서, ".NET Core" 기반의 "ASP.NET Web Application"을 만드는 것도 가능하지만, 어차피 동일한 ".NET Binary"이기 때문에 그것을 ".NET Framework" 기반에서도 운영할 수 있습니다.

하지만, "ASP.NET Core Web Application (.NET Core)" 프로젝트는 다중 플랫폼을 지원하지만 "ASP.NET Core Web Application (.NET Framework)"의 경우 오직 (Full .NET Framework 가 설치된) 윈도우 환경에서만 구동할 수 있습니다.

그럼, 왜 (.NET Core)와 (.NET Framework) 2가지를 만들어놨는지 의아스러울 수 있는데요. 가령, 다중 플랫폼 기반을 선호해서 ".NET Core" 위주로 개발된 프로젝트가 윈도우 용으로 동작할 때는 다른 라이브러리를 사용해야 하는데, 하필 그것이 .NET Framework에 의존적인 거라고 가정해 보겠습니다. 그런 상황에서 단지, 그 라이브러리 때문에 .NET Core 웹 프로젝트를 따로 유지하면서 별도로 "ASP.NET Web Application" 프로젝트를 가져가는 것은 부담일 수밖에 없습니다.




그 둘 간의 결정적인 차이점이라면, "(.NET Core)" 프로젝트는 빌드하면 .dll 파일이 나오고, "(.NET Framework)" 프로젝트는 .exe 파일이 나온다는 점입니다. 왜냐하면, Core 용은 호스팅이 dotnet.exe에서 되기 때문에 .dll로 되는 반면, (.NET Framework) 용은 ".NET Core"가 설치되지 않은 일반적인 ".NET Full Framework"가 설치된 환경에서도 구동될 수 있도록 "dotnet.exe"를 포함한 별도의 .exe 파일로 만들어지기 때문입니다.

실제로 배포된 바이너리를 기준으로 (.NET Core)의 web.config은 dotnet.exe와 .dll을 명시하고,

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath="dotnet" arguments=".\WebApplication1.dll"" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />
  </system.webServer>
</configuration>
<!--ProjectGuid: 028962a2-4bfe-4352-8f7d-6ee7fb543516-->

(.NET Framework)는 .exe를 명시하고 있습니다.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath=".\WebApplication1.exe" arguments="" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />
  </system.webServer>
</configuration>
<!--ProjectGuid: 66d5ea31-7436-44c2-8822-3cc000945e6e-->

따라서, (.NET Framework) 프로젝트는 ".NET Core Windows Server Hosting bundle"까지는 필요 없고 단지 그 구성요소 중의 하나인 "ASP.NET Core Module"만 해당 컴퓨터에 설치되어 있으면 됩니다. (즉, .NET Core가 설치되어 있을 필요가 없습니다.)

ASP.NET Core Module overview
; https://learn.microsoft.com/en-us/aspnet/core/fundamentals/servers/aspnet-core-module

그렇긴 한데, 현재 "ASP.NET Core Module"만을 위한 설치 파일은 없고 ".NET Core Windows Server Hosting bundle"에 함께 포함되어 배포되기 때문에 어쩔 수 없이 ".NET Core Runtime"과 ".NET Core Library"가 함께 설치가 됩니다.

물론 방법이 없는 것은 아닙니다. 다음과 같이 소스 코드를 공개하고 있기 때문에,

ASP.NET Core Module (소스 코드)
; https://github.com/aspnet/AspNetCoreModule

빌드해서 별도로 설치해 주면 됩니다. 또는, ".NET Core Windows Server Hosting bundle" 설치 파일인 aspnetcoremodule_x64_en_preview1_72.msi 파일을,

C:\ProgramData\Package Cache\{42C46B8A-86A1-4B94-9E9C-06B4BD6D8737}v1.0.1970\packages\aspnetcoremodule_x64_en_preview1_72.msi

이런 식으로 해제하면,

msiexec /a aspnetcoremodule_x64_en_preview1_72.msi TARGETDIR=c:\temp\ancm /qb

msi 압축이 해제된 폴더에서 aspnetcore.dll 파일을 구할 수 있습니다. 이것을 각각 다음의 폴더에 복사한 후,

C:\Windows\System32\inetsrv
C:\Windows\SysWOW64\inetsrv

다시, 저 2개 폴더의 하위에 있는 \config 폴더의 "applicationHost.config" 파일에 globalModules의 하위 노드에 다음과 같이 등록해 주시면 됩니다.

<configuration>
...[생략]...
    <system.webServer>
        ...[생략]...
        <globalModules>
            ...[생략]...
            <add name="AspNetCoreModule" image="%SystemRoot%\system32\inetsrv\aspnetcore.dll" />
        </globalModules>
    </system.webServer>
</configuration>

이외에 applicationHost.config에 약간의 변경을 가해야 하는데, 음... 일일이 쓰려니 귀찮군요. ^^; 그냥 차라리 aspnetcore.dll만 설치해 주는 더 나은 방법이 있으니 그걸로 해결하시면 됩니다.

그건 바로! ^^ 이미 ".NET Core Windows Server Hosting bundle" 설치 파일에서 ".NET Core Runtime"과 ".NET Core Library"에 대한 설치 없이 오직 aspnetcore.dll만 설치할 수 있도록 옵션을 제공하고 있기 때문에 다음과 같이 실행해 주어도 됩니다.

DotNetCore.1.1.0-WindowsHosting.exe OPT_INSTALL_LTS_REDIST=0 OPT_INSTALL_FTS_REDIST=0

하지만 그럴 필요는 많지 않을 것입니다. .NET Core Runtime 정도 설치하는 것이 시스템에 큰 부담이 있는 것은 아니므로 그냥 ".NET Core Windows Server Hosting bundle"을 평범하게 설치하는 경우가 대부분일 것입니다.




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

[연관 글]






[최초 등록일: ]
[최종 수정일: 11/30/2023]

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)
11099정성태11/7/201630626.NET Framework: 620. C#에서 C/C++ 함수로 콜백 함수를 전달하는 예제 코드파일 다운로드1
11098정성태11/7/201619965오류 유형: 368. 빌드 이벤트에서 robocopy 사용 시 $(TargetDir) 매크로를 지정하는 경우 오류 발생
11097정성태11/7/201622894오류 유형: 367. go install: no install location for directory [...경로...] outside GOPATH
11096정성태11/6/201626694디버깅 기술: 83. PDB 파일을 수동으로 다운로드하는 방법
11095정성태11/6/201622944.NET Framework: 619. C# - Cognitive Services 중의 하나인 Face API를 사용해 얼굴 인식 및 흐림(blur) 효과 적용 [1]파일 다운로드1
11094정성태11/5/201624604VC++: 105. Visual Studio 2013/2015 - Ceemple OpenCV 확장을 이용한 웹캠 영상 출력
11093정성태11/4/201624501웹: 34. Edge 브라우저도 지원하는 클립보드 복사를 위한 자바스크립트 코드
11092정성태11/3/201631486.NET Framework: 618. C# - NAudio를 이용한 MP3 파일 재생 [5]파일 다운로드1
11091정성태11/3/201626275VC++: 104. std::call_once를 이용해 thread-safe한 Singleton 객체 생성파일 다운로드1
11090정성태11/1/201627729VC++: 103. C++ CreateTimerQueue, CreateTimerQueueTimer 예제 코드 [9]파일 다운로드1
11089정성태11/1/201626512디버깅 기술: 82. Windows 10을 위한 Symbol(PDB) 파일 내려받는 방법 [2]
11088정성태11/1/201630675.NET Framework: 617. C# - AForge.NET을 이용한 MP4 동영상 파일 재생 [7]파일 다운로드1
11087정성태11/1/201625071.NET Framework: 616. AForge.Video.FFMPEG를 최신 버전의 ffmpeg 파일로 의존성을 변경하는 방법파일 다운로드1
11086정성태11/1/201618921오류 유형: 366. The Microsoft Passport Container service terminated with the following error: General access denied error
11085정성태10/27/201633263.NET Framework: 615. C# - AForge.NET을 이용한 웹캠 영상 출력 [2]파일 다운로드1
11084정성태10/26/201621373오류 유형: 365. The User Profile Service service failed to the sign-in.
11083정성태10/26/201627845Windows: 131. 윈도우 10에서 사라진 "Adapters and Bindings" 네트워크 우선 순위 조정 기능 [1]
11082정성태10/26/201629740.NET Framework: 614. C# - DateTime.Ticks의 정밀도 [4]파일 다운로드1
11081정성태10/26/201620275오류 유형: 364. You need to fix your Microsoft Account for apps on your other devices to be able to launch apps and continue experiences on this device.
11080정성태10/24/201623376Windows: 130. Windows Server 2016 Nano 서버 설치 방법
11079정성태10/21/201620532Windows: 129. Windows Server 2016 설치 CD에 있는 Convert-WindowsImage.ps1 사용 방법 정리
11078정성태10/21/201621860Windows: 128. Windows Server 2016 Nano 서버 VHD 이미지 만드는 방법 - TP5 기준
11077정성태10/21/201620368오류 유형: 363. Active Directory 서버의 NETLOGON 서비스가 멈췄을 때 발생하는 문제
11076정성태10/21/201619907오류 유형: 362. 윈도우 백업 시 오류 - 0x80780040
11075정성태10/20/201620887Windows: 127. Convert-WindowsImage.ps1 사용 방법 정리
11074정성태10/20/201629149Windows: 126. Windows Server 2016 평가판을 정식 버전으로 라이선스 변경하는 방법
... 106  107  108  109  110  111  112  [113]  114  115  116  117  118  119  120  ...