SQLProvider icon indicating copy to clipboard operation
SQLProvider copied to clipboard

Intellisense failure and random errors after sometime (VS 2019)

Open rkosafo opened this issue 6 years ago • 2 comments
trafficstars

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

  • The field, constructor or member 'Procedures' is not defined
  • The field, constructor or member 'Dbo' is not defined

2 Error at db.Procedures.uspxxxx.Invoke. Says The member of object constructor 'Invoke' takes 0 argument(s) but is here given x. The required signature is 'FSharp.Data.Sql.SqlDataProvider<...>.dataContext.Procedures.DboUspxxx.Result.Invoke(): Unit

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

  • Used database: SQL Server
  • Operating system: Windows 10
  • Branch: 1.1.62
  • .NET Runtime, CoreCLR or Mono Version: 4.6.1, .NET Standard 2.0
  • Performance information, links to performance testing scripts

rkosafo avatar May 04 '19 09:05 rkosafo

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

Thorium avatar May 14 '19 15:05 Thorium

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

Thorium avatar Feb 04 '20 12:02 Thorium