NuGet Integration!
For LINQPad Premium users, I've just released a beta with NuGet integration:
www.linqpad.net/beta.aspx
The idea is to use LINQPad as a scratchpad for NuGet packages. Click on a package and use LINQPad to experiment with it, exploring its functionality in an immediate, fun and .Dump()-friendly environment.
Go to query properties (F4) and click "Add NuGet". NuGet references are treated as first-class, so you can save them to snippets, use them in "My Extensions" and in defaults for new queries. When you update a NuGet reference, the effect is global, so saved queries will reference the latest version. And if you send a .linq file with a NuGet reference to someone else, it will ask them whether they'd like to download the NuGet library automatically upon opening the query.
Let me know how you get on!
Joe
www.linqpad.net/beta.aspx
The idea is to use LINQPad as a scratchpad for NuGet packages. Click on a package and use LINQPad to experiment with it, exploring its functionality in an immediate, fun and .Dump()-friendly environment.
Go to query properties (F4) and click "Add NuGet". NuGet references are treated as first-class, so you can save them to snippets, use them in "My Extensions" and in defaults for new queries. When you update a NuGet reference, the effect is global, so saved queries will reference the latest version. And if you send a .linq file with a NuGet reference to someone else, it will ask them whether they'd like to download the NuGet library automatically upon opening the query.
Let me know how you get on!
Joe
Comments
I just hope it doesn't happen to often.
(The exception is dependencies, where LINQPad honors the package's versioning policy.)
No: You don't need to update each query after updating a NuGet package. LINQPad handles this automatically. In fact, each query stores only the names of the NuGet packages that it references, not specific version numbers. It works out what version to use when you run the query.
So if a new version introduces breaking changes, yes, queries could break. If you think this is wrong, let me know how you think it should be solved. The problem with having each query reference a specific package version (like projects do in VS), is that updating a package globally would become cumbersome, because you might have dozens of queries referencing the old version. Each would need to be upgraded separately.
Of course, it could be an option, so after adding a NuGet reference, you could request that the query "lock in" to that version. But the difficulty with that is that you can't know in advance whether you'd want to apply a future update or not. The next release could contain an essential bug fix, be faster, and have a new feature that you requested. Or it could contain breaking changes. So, let's say you write and save a dozen queries that use Reactive Framework. Would you lock them into the current version or not?
Another factor is how to do it without complicating the UI (especially if it turns out to be a 1% scenario). I imagine most people want something that's simple and that "just works".
Yes I agree with your analysis. I really don't expect the current behaviour to cause a lot of trouble, I'm just stating that it could happen. I think it's the control freak in me who likes to control all dependencies of an application and of queries (I'm an architect you see :-).
Better keep it simple.
In the meantime, there's a simple workaround. After adding the reference to the NuGet package, click Close and then click the NuGet hyperlink in the 'Additional References' list. Select the option "Show assemblies in this package" and exclude Hammock.ClientProfile.dll. This will apply to all queries, so you'll have to do it only once.
Just trying to add a NuGet package in the latest beta ( 4.42.04 AnyCPU) via F4 and get a message saying that "Adding NuGet packages is only supported in LinqPad premium". I take it that premium means the autocompletion (which i have) is there any thing else i need to do??
I image I can work around this by specifying the proxy under system.net in LINQPad.exe.config but haven’t tried that yet, just letting you know in case this is something that requires fixing.
I've just upgraded to Premium for the Nuget support but can't get it to work. I'm also behind an authenticated proxy. I've added my proxy details to LinqPad. (The proxy address is http:// then the IP, and I've specified domain username/password). If I click Test it says it was successful, and checking for updates seems to suggest it's OK).
However when adding Nuget packages it says "NuGet.Core threw an exception. The remote server return an error: (407) Proxy Authentication Required".
One slightly odd thing about our arrangement here - I develop in a different domain to the internet proxy server so need to log in to be able to access it. (But, as mentioned, for LinqPad I have some credentials I can specify.)
Outside Nuget, if I go to "Download/import more samples" I get "This program cannot display the webpage". (I've never been too fussed about this not working here to be honest).
I'm using v4.43.04.
One other thing - I tried Keith's suggestion and added an authenticated proxy to my config file. It didn't seem to make a difference but I'm not sure if I've done it right!
John
anyway, thanks again for what is one of my favourite development utilities.
In other words, LINQPad considers pre-release packages to have a different identity to release packages. So you can safely have one query referencing the latest pre-release version and another referencing the latest release version.
Just upgraded to 4.43.06 but I'm afraid I'm still getting a 407 access denied error. I presume it uses the same web proxy as the rest of LinqPad? Just to clarify - I am specifying a proxy address, port and also credentials in here. If I use "automatically detect proxy" I get the 407 when I click Test as well.
I've tried with/without the "Disable Expect-100-Continue" and it doesn't seem to make a difference.
Sorry.
John
I see this is no longer a beta. Are you still looking into this or is there anything I can do to maybe workaround the issue?
I'm using Windows 2003 if that makes a difference. I could try to find a Win 2008 server to install it onto?
John
For example, in IE I put the IP of the proxy. In LinqPad I need to enter http:// in front of the IP. Also IE doesn't have options for credentials so I can't put them in there, whereas LinqPad does. But the IP address and port used are the same.
The Test button does work in the LinqPad settings, and LinqPad can check for updates OK. But, as mentioned, when I click "Download/import more settings" from the Samples tab I do get "This program cannot display the webpage"
Sorry for any hassles caused! Great to have it working now!
I have a script that uses a package from an internal NuGet feed and need people to add that to the list of Package Sources in LINQPad. Unfortunately they now get the "only when you pay" warning when they go F4 > Add NuGet...
I'd love for all of them to register LINQPad of course, but for now the message seems to scare them away from using my scripts. I couldn't find another option in the menu that leads to the Package Sources, but maybe I am overlooking something?
LINQPad
---------------------------
NuGet.Core threw an exception: The remote server returned an error: (407) Proxy Authentication Required.
I have tried all the same "tests" as JohnC.
regards
Alan
(I'm trying to get this client, (very large corporate) to use Linqpad as a replacement for their current very heavy weight enterprise Load Testing tool, but can't do this with this problem.)