Quantcast
Channel: LINQPad Forum
Viewing all 2658 articles
Browse latest View live

supportedFrameworks System.ArgumentOutOfRangeException

$
0
0
Hello, I seem to have somehow broken LINQPad on my system. Whenever I try to add any Nuget package to a query, I get an System.ArgumentOutOfRangeException. The "view more details" just says "Specified argument was out of range. Parameter name: sourceFrameworks". This happens with any package I try to install, not just a specific one. I've tried uninstalling/reinstalling LINQPad, clearing out any AppData folders I can find, installing the beta version, etc. but nothing works. Every time I try to install a package, even on a fresh installation of LINQPad, I get the same exception. I'm sure I've accidentally goofed something up, but I'm not sure what or how I might fix it.

Linqpad Start menu delay after boot

$
0
0
This is a tiny usability niggle that I couldn't see mentioned anywhere. Steps: 1. Reboot a Windows 10 system 2. Click the Linqpad shortcut in the start menu Expected: The start menu instantly closes, and Linqpad launches shortly afterwards. Actual: The start menu remains open, and Linqpad launches 2-3 seconds later. What happens is that I assume I haven't clicked the shortcut (as the start menu is still open), so I click it again. I then end up with two copies of Linqpad running :) This only happens on the first launch of Linqpad after booting, but happens separately for both Linqpad 4 and 5. Workaround: Pin to taskbar. This really doesn't matter, but it got me wondering about when exactly the start menu closes, so I thought I'd mention it!

BenchmarkDotNet in LinqPad

$
0
0
Hi all, I'm just not able to move forward with BenchmarkDotNet in LinqPad. Basically I have same problem as tym32167 on his github issue : https://github.com/dotnet/BenchmarkDotNet/issues/593#issue-276705515

// Validating benchmarks:
Assembly LINQPadQuery, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null is located in temp. If you are running benchmarks from xUnit you need to disable shadow copy. It's not supported by design.
I'm trying to run a sample from benchmarkdotnet issue 580 https://github.com/dotnet/BenchmarkDotNet/issues/580

void Main()
{
	var summary = BenchmarkRunner.Run();
}

public class Md5VsSha256
{
	private const int N = 10000;
	private readonly byte[] data;

	private readonly SHA256 sha256 = SHA256.Create();
	private readonly MD5 md5 = MD5.Create();

	public Md5VsSha256()
	{
		data = new byte[N];
		new Random(42).NextBytes(data);
	}

	[Benchmark]
	public byte[] Sha256() => sha256.ComputeHash(data);

	[Benchmark]
	public byte[] Md5() => md5.ComputeHash(data);
}
Adam Sitnik is saying that the issue was solved, but it doesn't work. BenchmarkDotNet version 0.11.5.1095 (their CI nuget server) LinqPad version 5.39.00 Roslyn Preview > Use experimental Roslyn assemblies. (but checking or unchecking this doesn't make any difference) Compiler optimization on (/o+) Do not shadow assembly reference True. I kindly ask you to any how-to, if there's any. Thanks.

BenchmarkDotNet in LinqPad (AnyCPU) throws an Exception

$
0
0
Recently I posted an issue with BenchmarkDotNet (https://forum.linqpad.net/discussion/1872/benchmarkdotnet-in-linqpad#latest). This turned out to be issue of completely different kind. But during investigation I tried several LinqPad versions. Beta versions, x86 or AnyCPU I was able to run BenchmarkDotNet in LinqPad, but only in x86 build. AnyCPU build will throw an FileLoadException. Assembly is still being loaded. (Exception from HRESULT: 0x80131016)
 at BenchmarkDotNet.Portability.RuntimeInformation.get_IsFullFramework()
   at BenchmarkDotNet.Portability.RuntimeInformation.GetCurrentRuntime()
   at BenchmarkDotNet.Characteristics.Resolver.<>c__DisplayClass1_0`1.b__0(CharacteristicObject obj)
   at BenchmarkDotNet.Characteristics.Resolver.Resolve[T](CharacteristicObject obj, Characteristic`1 characteristic)
   at BenchmarkDotNet.Toolchains.ToolchainExtensions.GetToolchain(Job job)
   at BenchmarkDotNet.Running.BenchmarkRunnerClean.<>c__DisplayClass12_0.b__2(BenchmarkCase benchmark)
   at System.Linq.Enumerable.WhereArrayIterator`1.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at BenchmarkDotNet.Running.BenchmarkRunnerClean.<>c__DisplayClass12_0.b__0(BenchmarkRunInfo info)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at BenchmarkDotNet.Running.BenchmarkRunnerClean.Run(BenchmarkRunInfo[] benchmarkRunInfos)
   at BenchmarkDotNet.Running.BenchmarkRunner.RunWithDirtyAssemblyResolveHelper(Type type, IConfig config)
   at BenchmarkDotNet.Running.BenchmarkRunner.RunWithExceptionHandling(Func`1 run)
   at BenchmarkDotNet.Running.BenchmarkRunner.Run[T](IConfig config)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
I don't know if this can be called a defect and to which project it actually belongs ...

Including one .linq file inside another - please comment

$
0
0
I've just written a proposal for an upcoming new feature - referencing .linq files from other queries: https://www.linqpad.net/LinqReference.aspx Please let me know what you think!

LPRun.exe . . . . how to tell if process finished

$
0
0
"C:\Program Files (x86)\LINQPad5\LPRun.exe" -format=csv C:\Users\Me\LinqPadDemo\GetData.linq > OutputData.csv In the above example, a script is executed and data is dumped out as a csv file. The file can take several minutes to output. Once the data is written to file, I then import it into a database. Is there are way of telling if the file has been completely written so that I avoid any chance of attempting to import the data while the file is incomplete? Hope that makes sense!

Linqpad 6 - EfCore driver not working

$
0
0
Hi, first of all congrats for the V6 release - its awesome. I want to report a bug with the ef core driver in V6. I have tested it against a 2.2 Version of EFCore and a 3.0-Preview version. Both versions are not working when using the DBContextOptions constructor: Linqpad 6 correctly recognizes the ctor, but it does not work (Neither when clicking "Test", nor when clicking "OK")

Feature request: EfCore DbContext Postgres support

$
0
0
The EF DbContext Connection dialog currently only supports "SQL Server" or "SQLite" Please support other options like Postgres and/or mysql. Thanks.

LINQPad6 LINQ to SQL driver - self referential table

$
0
0
Hi, and let me congratulate you for the LINQPad6 preview, looks amazing already. I was doing some tests on my company's database and I've noticed the following. One of our tables contains a self referential association. Using ILSpy I can see what LINQ2Sql driver was generating as a class definition. I've stripped out the irrelevant details and it comes down to the following:
public class TheEntityName
{
	[Column(IsPrimaryKey = true, DbType = "Int NOT NULL", UpdateCheck = UpdateCheck.Never)]	
	public int EntityId;

	[Column(IsPrimaryKey = true, CanBeNull = false, DbType = "VarChar(50) NOT NULL", UpdateCheck = UpdateCheck.Never)]	
	public string Key;

	private EntityRef _Child;
	private EntityRef _TheEntityName;


	[Association(Name = "FK_TheEntityName_TheEntityName", Storage = "_TheEntityName", ThisKey = "EntityId,Key", OtherKey = "EntityId,Key", IsForeignKey = true)]
	public TheEntityName TheEntityName
	{
		get { return _TheEntityName.Entity; }
		set { _TheEntityName.Entity = value; }
	}
	
	[Association(Name = "FK_TheEntityName_TheEntityName", Storage = "_Child", ThisKey = "EntityId,Key", OtherKey = "EntityId,Key", IsForeignKey = false, IsUnique = true)]
	public TheEntityName Child 
	{
		get { return _Child.Entity; }
		set { _Child.Entity = value; }
	}
}
I suppose that the code above is generated by the runtime directly as obviously if you tried to set up something similar in C# you would get a compile time error: CS0542: member names cannot be the same as their enclosing type. LINQPad6 is definitely attempting to perform the same as I can see this error when I'm trying to set up a connection. To be absolutely fair, I'm not sure what the actual reasoning behind the association above currently is and probably I could remove it and that would solve the problem. However in a more general approach and assuming that such association is indeed necessary, is it possible to modify the driver code in order to generate a property name that does not violate CS0542? Thanks

Linqpad 6 small bug - Group key not shown in dump output when dumping async queryable

$
0
0
Linqpad 6s dump result does not print the Group "Key" property when dumping EfCore async Queryables: Persons.AddRange(Enumerable.Range(0, 100).Select(i => new Person() { Value = $"Person {i}" })); SaveChanges(); (from p in Persons group p by p.Id.ToString()[0] into g select g) //.ToList() // Uncomment this and the group key is correctly dumped. .Dump(); When using without ToList(), the group "Key" property is not displayed within a group: With leading ToList() everything is fine:

Display issues in Parallels

$
0
0
Hi - I'm running LinqPad Pro on Win7 in a VM on Parallels on Mac OS X Lion. I realize it's a edge case, but in "Coherence Mode" where Parallels hides the desktop and shows Windows windows amongst Mac OS windows, there are some redrawing issues. The two issues I've experienced are autocomplete windows leaving shadows behind that cannot be cleared away and results in a grid cause the entire app to flicker and disappear. Love this app. Clearly a work of passion. Thank you.

C# 8 preview feature not available in LINQPad preview 6.0.9

ToString method when using .Dump

$
0
0
Hi, Would it be possible to get a feature implemented in linqpad, where linqpad does not call .ToString() on the objects being dumped. The reason for this that if you have implemented a ToString() method on a class you don't neccessary want it to be used when calling .Dump(). Example: ---------------------------------------------------- void Main() { var c = new ClassWithToString(); c.Dump(); var c2 = new ClassWithoutToString(); c2.Dump(); } public class ClassWithoutToString { public int MyProperty { get; set; } public int MyProperty2 { get; set; } public int MyProperty3 { get; set; } } public class ClassWithToString : ClassWithoutToString { public override string ToString() { return $@"{MyProperty}, {MyProperty}, {MyProperty}"; } } ---------------------------------------------------- In this example the result for ClassWithToString in the dump window looks silly, since Dump calls ToString() as part of dumping. Where for the ClassWithoutToString looks as "expected" - where it just uses the name of the class. Thanks in advance

[Proposal] Add Dump sink provider

$
0
0
It's very useful when using Dump method, but when I want to use Dump as logging in some scheduled task via lprun.exe, it's not very handy. I propose create a DumpSinkProvider, by add a DumpSinkProvider, I can log the dumped information to any place I specified, like rolling filesystem, or database.

Any ETA for LINQPad 6 command line tool(aka lprun.exe)?

$
0
0
It's required to use lprun.exe to do some agent/scheduled tasks. Wondering if lprun.exe is coming soon?

Error when trying to run F# HTML Parser

$
0
0
New F# program with this line of code let results = FSharp.Data.HtmlDocument.Load("http://www.google.com/search?q=FSharp.Data") But I get a MissingMethodException Method not found: 'FSharp.Data.HtmlDocument FSharp.Data.HtmlDocument.Load(System.String, Microsoft.FSharp.Core.FSharpOption`1)'. Code runs ok in VSCode, Am I missing something ? Seems like it is having some sort of issue with the optional parameter.

Possible to hide code window like Interactive Regex Evaluator with code?

$
0
0
I want to publish the LINQPad script to our customer. For user-friendly purpose, I want to hide the code, and just show the dumped result in LINQPad window (without request the user click the "Undock results into second monitor (F8)" button), like Interactive Regex Evaluator, is that possible?

Macro or Util to identifier LINQPad version?

$
0
0
Some API, like Util.Cmd, have the different API between LINQPad 6 and LINQPad 5, I want to make it compatible in these 2 different scenario, but also want make a good use of new streamResults = true. So I want something like
#if LINQPad6
or
if (Util.LINQPadVersion.Major == 6)
to make it possible.

Incorrect code highlight when using LINQPad 6's using declarations

$
0
0
As the picture shows, the second line of using declaration's code highlight is broken.

[Bug]SkiaSharp's native library not working using LINQPad6

$
0
0
Install SkiaSharp NuGet package and write following code: var bitmap = new SKBitmap(260, 260); LINQPad 6 will report following error: The InnerException is DllNotFoundException and message is: Unable to load DLL 'libSkiaSharp' or one of its dependencies: The specified module could not be found. (0x8007007E) While everything working perfectly fine in LINQPad 5.
Viewing all 2658 articles
Browse latest View live