SQLProvider icon indicating copy to clipboard operation
SQLProvider copied to clipboard

.NET Standard - Stack Overflowing

Open TIHan opened this issue 6 years ago • 1 comments

Hey all,

I've been investigating an issue by Scott Hutchinson reported here: https://developercommunity.visualstudio.com/content/problem/226479/vs-2017-version-1564-freezes-and-crashes-when-addi.html

While I was looking at the issue, it appears that SQLProvider is stack overflowing at design time and crashing VS, but only if you are trying to use it in a .NET Standard project. In a .NET Core library or console project, it doesn't stack overflow or crash VS.

I am not familiar enough with the internals of type providers and SQLProvider's implementation to give an assessment of what exactly is the cause. It could be SQLProvider's implementation or something on our end, but I figured it would merit a report here.

If you can test it on VS 15.6.5 or 15.7 previews that would be great. Here is an example project: ConsoleApp20.zip

If you open this, it should freeze VS. Under debugging, you can see where SQLProvider stack overflows. stack_overflow

Related issues: https://github.com/Microsoft/visualfsharp/issues/4661

TIHan avatar Apr 09 '18 21:04 TIHan

To use type provider with .NET Standard you have to use compatible fsharp compiler and do the compilation with .Net451 version of SQLProvider.dll. On runtime you can use the .NET Standard dll. See: https://github.com/fsprojects/FSharp.TypeProviders.SDK/issues/182#issuecomment-357030011

Thorium avatar Apr 10 '18 08:04 Thorium