Skip to content

Pythonnet을 활용한 C# #8

@SAgiKPJH

Description

@SAgiKPJH

C#

  • FastAPI는 Python 기반으로 만들어진 프레임워크이기 때문에 C#에서 직접 FastAPI를 사용하는 것은 불가능합니다.
  • C#에서는 Python 코드를 호출하는 방식으로 진행합니다.
  • 보통 C#에서 Python 코드를 호출하려면 IronPython를 활용
  1. Python.Runtime 설치
    • 다음 명령어를 입력하여 Python for .NET을 설치
    pip install git+https://github.com/pythonnet/pythonnet

image

  • Visual Studio > 참조추가 > 설치한 Pythonnet 위치에서 [-Python.Runtime.dll-]를 참조
  • 또는 ADC 프로젝트의 ExternalDLL에 Python.Runtime.dll이 존재하는데, 이를 활용

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions