fsprojects / SQLProvider

A general F# SQL database erasing type provider, supporting LINQ queries, schema exploration, individuals, CRUD operations and much more besides.
https://fsprojects.github.io/SQLProvider
Other
572 stars 146 forks source link

Intellisense failure and random errors after sometime (VS 2019) #613

Open rkosafo opened 5 years ago

rkosafo commented 5 years ago

Description

When the project is opened for a while (variable time - some time 10 mins, others 30 mins depending on what is done), the following issues are seen (can be in any combination)

1 The members are reported as undefined

3 Error creating SQL. Says connection string is not set. This has happened only twice or so.

I've tried with and without ContextSchemaPath. Issue 2 seems to happen more often with ContextSchemaPath set.

I do not have these issues with a previous project but that has a relatively small db. This current db has a lot of stored procedures, functions, view and tables. Not sure if that can be a factor. When it starts project builds. After sometime, project fails to build. What am I doing wrong?

Repro steps

Please provide the steps required to reproduce the problem

  1. Add TP to project

  2. Continue coding as always and leave window idle for a while

  3. Check the Error List window for any database related errors

Expected behavior

Intellisense works and code compiles

Actual behavior

For issue 1, project builds successfully. After sometime, it fails to build and shows the errors. For issues 2 and 3, project does not build at all db.Procedures. does not yield any intellisense

Known workarounds

Restart Visual Studio whenever project can't build.

Related information

Thorium commented 5 years ago

Thanks for reporting. I'll try to see what goes wrong but I expect this one is not easy to debug.

Thorium commented 4 years ago

Did you have network connection lost? The TypeProvider SDK has been updated, is this still happening?

Also, on runtime you can do simple manual reconnection like this: https://github.com/fsprojects/SQLProvider/issues/397#issuecomment-296618798