dimanche 16 décembre 2018

Path of file that will be in the publish directory

Hello i want to know how can i open a file that at runtime in Release mode will be in the same directory with the dll that is executing.More specifically i am deploying the .NET Core application with docker and i am already copying the publish folder.In this folder i will also copy my file.

So the folder at runtime will look like:

-Publish
 - Executing.dll
 - myfile
 - Microsoft.Package 1
 - Microsoft.Package 2
 .....................

From code i want to get the file.What will the path be to reach it?Do i need System.Reflection?

Dockerfile

FROM microsoft/dotnet:2.2-sdk
WORKDIR /app  
COPY . /app    //the file will be here in .
ENTRYPOINT ["dotnet","publish/Server.dll"]
EXPOSE 8300





Aucun commentaire:

Enregistrer un commentaire