[Python] A way where to keep and how to copy python files to C# project output directory

Discussão em 'Python' iniciado por Stack, Setembro 30, 2024.

  1. Stack

    Stack Membro Participativo

    I have a C# project which works with python web server, written with FastAPI. Server is a part of C# application, and runs and shuts down by C# app.

    I usually work only with C# apps and have no experience in cases, when there are two or more projects in repo, which form one app, but written in different programming languages. So, I'm interested in two things:

    1. Is there any common practice where to keep python files in repo with C# solution (e.g. in C# solution folder or somewhere else)?
    2. How to copy python files into C# project output directory on build? I know about call of "Copy" function in csproj, but maybe there are other approaches available? There is an option in Visual Studio to create Python project (pyproj), and I hoped that it is possible to create a reference from C# project to Python project, to copy python files automatically on build, as it is happens with C# dependencies, but it didn't work for me. Does anyone know if such option available?

    Continue reading...

Compartilhe esta Página