-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
C#
- FastAPI는 Python 기반으로 만들어진 프레임워크이기 때문에 C#에서 직접 FastAPI를 사용하는 것은 불가능합니다.
- C#에서는 Python 코드를 호출하는 방식으로 진행합니다.
- 보통 C#에서 Python 코드를 호출하려면
IronPython를 활용- 하지만 FastAPI는 Python 3.6 이상의 버전을 필요하는데 비해
IronPython 3.4.0는 python 3.4 버전이기에 활용할 수 없습니다.- 따라서
CPythonPythonnetPython.Runtime을 활용한다. (https://github.com/python/cpython) (https://github.com/pythonnet/pythonnet)
- Python.Runtime 설치
- 다음 명령어를 입력하여 Python for .NET을 설치
pip install git+https://github.com/pythonnet/pythonnet
- Visual Studio > 참조추가 > 설치한 Pythonnet 위치에서 [-Python.Runtime.dll-]를 참조
- 또는 ADC 프로젝트의 ExternalDLL에 Python.Runtime.dll이 존재하는데, 이를 활용
Metadata
Metadata
Assignees
Labels
No labels
