Project requirements?
Hello there.
I am about to publish a project I have written, however, I am little unsure how you usually handle libraries when publishing the project. In Python, you usually have a requirements.txt file listing all the libraries used by the project. How do you do that in C#? I want to ensure the recipient is able to run the project without having to look at the code.
2 Replies
Dependencies are handled automatically, either through NuGet packages or external project references. When cloning and building the project from source, project references are automatically linked as long as they are present in the repo, while NuGet packages are restored. When publishing a build, dependencies are included in the form of dlls
Builds also include a deps.json file listing dependencies
yeah as boxy said, its all done for you. a "source release" meant for the user to compile themself will contain the nuget references inside the csproj file, and a finished pre-compiled release will just include the dependencies in the release itself - either as a single file (see
$singlefile
for more info) or just as part of a zip file or something.