Home

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.

Comments

  • edited April 2013
    This can't be done right now, but there's a fairly popular request for it on UserVoice.
  • Hi Joe
    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?
  • This feature has not yet been implemented. There are a lot of issues to solve in order to make this work.
  • Joe
    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.
  • Hey Joe. Just wondering if you're still thinking about this request :)
    We'd be glad to help you out iron out some issues if that's the case, just say the word.

    Thanks!
  • Found this discussion while looking for an answer to the topic question. LINQPad is the greatest thing since sliced bread. If you could add the feature of creating DLLs with it, it would be the greatest thing since the creation of fire.
  • What do you plan to do with the DLLs that you create? Consume then from another LINQPad query - or from a Visual Studio project?
  • What do you plan to do with the DLLs that you create? Consume then from another LINQPad query - or from a Visual Studio project?

    Both. Now, it's not a big deal to ctrl-a my way from a query to VS and make my DLLs that way. But somehow I feel a lot less "cramped" working in LINQPad, so I like to use it whenever I can, instead of VS. VS's IDE is kind of overwhelming. I'm an old vi/Unix guy. To me, a VT-100 and my whiteboard are almost all the IDE I want.

    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.

  • There's also now been the ability to #load other queries (since LINQPad 6). Does this help?

  • @JoeAlbahari said:
    Have you tried LINQPadless?
    https://github.com/atifaziz/LinqPadless

    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.

    @JoeAlbahari said:
    There's also now been the ability to #load other queries (since LINQPad 6). Does this help?

    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.

Sign In or Register to comment.