In Visual Studio, when you right click a reference, you can "Add Fakes Assembly", which kicks off a process that generates the *.Fakes.dll assembly.
When I looked into it, it seems that it utilizes one of the following files:
- Fakes.exe
- Fakes.v2.exe
- Fakes.v2.x86.exe
- Fakes.x86.exe
I'm not sure which one, but it has to be one of those. Those files are located in (at least on my machine, but this is the common path): C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\Fakes
The problem here is that if I want to call the fakes generation tool through command line, I have to hard code in the path which may or may not be that path. I know in the past when I attempted to programmatically discover ildasm.exe and ilasm.exe someone showed me that it was possible: Guaranteed way to find the filepath of the ildasm.exe and ilasm.exe files regardless of .NET version/environment?
I'm wondering is there anything similar to get the correct path for the fakes tools without having to hard-code the path in since it is unreliable to assume everyone uses the default installation drive/path and also I shouldn't assume that everyone has Visual Studio 2015, 2017, or other future versions installed.
Update:
I think my original question was not clear in what I'm trying to do. If I have a solution/project, this is easy to do. However, I want to do this outside of a solution/project; I want to either use a standard command window or even a PowerShell script is acceptable. Basically, I don't want to have to create a solution/project merely to access the path to the fakes tooling.