How to get lprun output folder?
I hope to get path of command lprun
output folder.
e.g
every time cmd lprun LINQPad will create dll in \AppData\Local\Temp\LINQPad5\
like below photo.
thanks!
I hope to get path of command lprun
output folder.
e.g
every time cmd lprun LINQPad will create dll in \AppData\Local\Temp\LINQPad5\
like below photo.
thanks!
Comments
Try
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)
@nescafe thanks,yes it could get path on running linq file.
but if i use cli
lprun
it can not return output path.e.g
if i use
ipconfig
, windows system can returnip infoformation
The output folder is dynamic, so a separate lprun cli command would refer to another directory.
You could copy the dll to a known location as part of the script, e.g.
File.Copy(Assembly.GetExecutingAssembly().Location, @"C:\Temp\LINQPadQuery.dll");
Somewhere in your main function, or echo the location at the end of your script:
Console.WriteLine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));
What are you trying to achieve?
Thanks!
I try to make a unity, it can input .linq file path then output exe like
Linqpadless
project.and the logic is using linqpad's cli
lprun
then adding the generatedLINQPadQuery.dll
to my exe,so i have to get the lprun output path.You could use the following script to compile the dll and get a reference to the most recent generated file in the temporary folder within the same application lifetime.
wow,it's a solution,thanks!