Give option to generate EXE
It would be nice to be able to fine tune my query then click "make EXE". An executable would be produced that just ran the query and showed the Dump results as if I had run it directly in LINQPad. A more advanced option would be to allow some simple parameters to be passed and used in the query. This way I could write some simple reporting queries and then give them to someone else or add shortcuts to easily run them again myself.
-
何何华 commented
I take it after 10 years this is never going to happen. Does the developer even watch this UserVoice anymore?
-
Charles Burns commented
Isn't this what an IDE is for? Or VSCode? Or the command line?
LINQPad is, to me, for quick code tests, quick queries, quick snippet tests.
If the developer starts adding features like this, LINQPad will cease being LINQPad and will become an ersatz VSCode. Not a good direction. -
andrew campbell commented
I would love this as a native function within LINQPad 7 please :-D
-
何何华 commented
+1
I take it after 10 years this is never going to happen. Does the developer even watch this UserVoice anymore? -
Jeremy Simmons commented
https://github.com/atifaziz/LinqPadless fills this need.
-
Mason commented
I take it after 10 years this is never going to happen. Does the developer even watch this UserVoice anymore?
-
Anonymous commented
I added my vote, but to clarify i want it to build a windows application that has the dump window ... the idea is, i can make a tool for someone in my office and just give them an exe... they don't need to see any linqpad chrome (including the source code or the connections). i use the dump window (including linqpad controls) ... so this isn't a command line scenario.
Would be great to allow dumping to DataGrids as well ... essentially the UI would be everything that happens today below the actual source code editor
-
WadersTheUltimateDeveloper commented
Well you could use https://www.gnu.org/software/dotgnu/ to compile
-
Jude Boka commented
why not installing Rosalyn and use "csc" to compile the file
-
Tyler commented
@raboof thanks for the link!
-
raboof commented
So while waiting for this to become available as part of LINQPad proper, I've scratched my itch as the project LinqPadless:
https://github.com/linqpadless/LinqPadless
For those of us using LINQPad as a mere lightweight IDE, it enables turning LINQPad scripts/queries into stand-alone C# scripts (csx) or executables for automation and distribution to others. If you rely on all the run-time bells & whistles of LINQPad then this is not for you. See documentation limitations.
I'm sharing this in the hope that there may be interest in collaborating on the project.
-
Ash commented
If Linqpad could build assemblies, along with integrated debugger etc, I wouldn't need to touch Visual Studio for many applications. Hmmm, I wonder why such an obvious feature hasn't been added?
-
Anonymous commented
Also if the output exe could be IL merged with in NuGet packages referenced
-
wangzq commented
Here is my take to compile a LinqPad query as Dll or Exe by generating a msbuild project file: https://github.com/wangzq/lpmake
It supports nuget packages by leveraging project.json support in nuget 3 and latest msbuild.
-
Eric Wu commented
@JohnStevens, I am. Mind sharing? :)
-
John Stevens commented
I have a way to generate an assembly from a LINQPad script with a LINQPad script if anyone is interested
-
Michael Surikov commented
lprun.exe is not an option when you need to start multiple instances of the same or different LINQPad scripts at about same time because of lprun.exe first cleans up "old" files in its temporary folder like %TMP%\LINQPad and finally it deletes (!??) this folder at all. So, some instances can not find their compiled dll's as they were deleted by another instance of lprun.exe. This is why I vote for an ability to generate exe files for my LINQPad scripts to do not compile on the fly.
-
Matt commented
Why not add support for the C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe commandline compiler? Should not be too difficult to include a converter which generates *.cs files ... if some restrictions apply, like ommitting the .Dump() and use the Console.WriteLine() instead, it seems to be achievable. Something like a "Generate console app from LinqPad project". Like Martin already mentioned ... but the issue is that a LinqPad file handles the references differently, so something like an "export to console app" would be great.
-
Martin Kirk commented
soooooo ... why don't you simply copy the code to Visual Studio to a Windows Commandline solution ?
the output/dump would be the only issue - but easily solvable.
-
Sergii Sakharov commented
One more use case - IL generation/weaving testing. Used to be quite easy with snippet compiler which had this option.
lprun is completely irrelevant in this case.