Compile LINQPad query (under C# Program-mode) into a standalone dll
Just curious that is there any way to find or compile the query (C# statements / programs) into a standalone dll.
There are times where I would like to create a new class in LINQPad, and export it as a dll.
e.g.
public class MyClass
{
private string _Name;
public string Name { get { return this._Name; } set { this._Name = value; } }
}
I wish to be able to export it as a dll on the fly.
There are times where I would like to create a new class in LINQPad, and export it as a dll.
e.g.
public class MyClass
{
private string _Name;
public string Name { get { return this._Name; } set { this._Name = value; } }
}
I wish to be able to export it as a dll on the fly.
Comments
This post was over 2 years ago and I was searching to see if this was possible and ran across this post. I've been searching and reviewing the latest release but not sure if this was added. Is it possible to compile into a standalone DLL with the latest release?
Thanks for the timely response. I'd also like to join many others and say how incredibly useful LINQPad is and I've only just become familiar with a fraction of what it's capable of. Thanks for all you do to make this such wonderful and quality software.
We'd be glad to help you out iron out some issues if that's the case, just say the word.
Thanks!
Most recently, my wish for this feature arose as I was writing some simple code to draw lines in bitmaps. When I am just experimenting or getting started on something new, I always use LINQPad first. What happened here was that I expanded from just lines to solid shapes. That called for a simple polygon clipper and a related polygon filler (scan-converter, if you prefer). Now, that polygon code enabled a lot more than just solid lines so, before I knew it, I had four or five tabs each with its own query, and all of them duplicating that polygon code. I realized my polygon code had become a library, which I ought to be maintaining on its own, and making available in a shared compiled form (just like any other library).
That all took place purely in a LINQPad context, so I'd be thrilled to have the ability to create and use DLLs as shared resources entirely in that context. But, my little set of polygon routines was created to support code I was developing for eventual use in a VS project (Unity, actually), so it ultimately has to be accessible from VS as well. I just like using LINQPad so much more than VS that, if I could, I'd do everything with it.
HTH, and thanks for asking,
Searched for an alternative, found myself asking the same question 5 years ago.
Since then, we've had welcome upgrades (LinqPad4 , 5, 6 and 7). Can't overstate how productive this tool has made me.
Still, the itch is still there: Being able to dll' an existing query would save tons of space in my My Extensions file, and streamline the development even more.
Have you tried LINQPadless?
https://github.com/atifaziz/LinqPadless
There's also now been the ability to #load other queries (since LINQPad 6). Does this help?
It's an interesting idea, and one I'll certainly try for future
lprun
'ed scripts, but sadly it doesn't fit my needs; I would require it to export the classes I created within so that I could reuse them in other .linq files. I don't seem to be able to reference the classes from the .exe file - which could be an issue on how I generated it in the first place.I'm sure I positively danced with joy when I first saw that a few years back, and don't know how I forgot about that.
Seems promising for my use case. I'll give it a try and let you know.
More info on #load here: https://www.linqpad.net/LinqReference.aspx