Adding the referenced assemblies to the compiler parameters (I assume that is what compars
is referring to) will make sure the compiler uses that dll as reference at compile-time. During execution of the compiled program, the operating system will try to locate the referenced assemblies in the "usual way".
There are so many detailed specifications on this that you could read them 24/7 until your death (e.g. https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order).
But to accomplish what you want, namely to have the compiled program use the specific dll
from your temp folder at run-time, you can merge it with ILMerge as suggested in Mostafa Khodakarami's answer. The library will become an integral part of yours. Your dll will not be at risk of failing to find the needed reference, but it will also not use a newer version of the referenced library if one is available. Depending on how you do the merging, you also might not be able to share objects created with the library with other third party libraries that also use it, unless you also merge them.
Another tool to do the merging is ILRepack (see https://github.com/gluck/il-repack) which touts itself as being better than ILMerge. We switched from ILMerge to ILRepack because we reached some kind of internal limit on the number of objects in ILMerge.
Finally, you could also have your program load the dll
itself "manually" by using
public static System.Reflection.Assembly LoadFrom (string assemblyFile);
(see https://learn.microsoft.com/en-us/dotnet/api/system.reflection.assembly.loadfrom?view=net-6.0)
Call the method like this at the beginning of your program, before any methods are called or objects created that use that library:
Assembly.LoadFrom(Path.GetTempPath() + "\\Newtonsoft.Json.dll");