C# Environment variable
Hello,
I am a C# beginner and I want to modify the link of the dll to an env variable to work with several people on the project
I don't know if this is good practice but I put a variable like this in my csproj file
But I can't find how to add them then, I tried with the windows environment variables, I searched in Visual Studio 2022 but I couldn't find how to do it.
Thanks for your help
6 Replies
i'm going to guess this is for modding and there isn't a proper nuget package that includes the dependencies you need?
last time i needed something like this i used symlinks and didn't mess with any dynamic configuration in the project
(as in, manually symlink the directory containing the binaries to a known location before opening the project)
Yes, I don't understand very well so I have to do for example
mklink C:\dll\myDll.dll secondArgument
So what should I put as the second argument? And I have to do this for all dlls?
you could link the whole directory instead
this is the script i used in said project https://github.com/TorchAPI/Torch/blob/master/Setup%20(run%20before%20opening%20solution).bat
In the example there is
mklink /J GameBinaries "%path%"
so I have to do
like that ? How will visual code know where to look for dll?
you make the hint path point to wherever you symlinked the directory, there is no variable in it this way
https://github.com/TorchAPI/Torch/blob/master/Torch.Server/Torch.Server.csproj#L106-L110
ohhh ok
Thanks a lot !!