Skip to content

SqlFile crashes Visual Studio #240

@mrinaldi

Description

@mrinaldi

Description

Using SqlFile and changing the file used by SqlFile throw a NullReferenceException.

Repro steps

  1. Create a .sql file and use SqlFile provider.
  2. Change the contents of the .sql file and saves.

Expected behavior

No crash

Actual behavior

Visual Studio crashes with:

Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
   at System.Runtime.Caching.MemoryCacheStore.RemoveFromCache(System.Runtime.Caching.MemoryCacheEntry, System.Runtime.Caching.CacheEntryRemovedReason, Boolean)
   at System.Runtime.Caching.MemoryCacheStore.Remove(System.Runtime.Caching.MemoryCacheKey, System.Runtime.Caching.MemoryCacheEntry, System.Runtime.Caching.CacheEntryRemovedReason)
   at System.Runtime.Caching.MemoryCache.RemoveEntry(System.String, System.Runtime.Caching.MemoryCacheEntry, System.Runtime.Caching.CacheEntryRemovedReason)
   at System.Runtime.Caching.MemoryCacheEntry.OnDependencyChanged(System.Object)
   at System.Runtime.Caching.ChangeMonitor.OnChangedHelper(System.Object)
   at System.Runtime.Caching.ChangeMonitor.OnChanged(System.Object)
   at FSharp.Data.SqlClient.SingleFileChangeMonitor.TriggerOnChange()
   at FSharp.Data.SqlClient.SingleFileChangeMonitor.TriggerOnFileChange(System.String)
   at <StartupCode$FSharp-Data-SqlClient>.$SingleFileChangeMonitor+-ctor@19-61.Invoke(System.IO.FileSystemEventArgs)
   at Microsoft.FSharp.Control.CommonExtensions+SubscribeToObservable@2103[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].System-IObserver`1-OnNext(System.__Canon)
   at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers+h@788[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Invoke(System.Object, System.__Canon)
   at <StartupCode$FSharp-Data-SqlClient>.$SingleFileChangeMonitor+-ctor@19-60.Invoke(System.Object, System.IO.FileSystemEventArgs)
   at System.IO.FileSystemWatcher.OnDeleted(System.IO.FileSystemEventArgs)
   at System.IO.FileSystemWatcher.NotifyFileSystemEventArgs(Int32, System.String)
   at System.IO.FileSystemWatcher.CompletionStatusChanged(UInt32, UInt32, System.Threading.NativeOverlapped*)
   at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32, UInt32, System.Threading.NativeOverlapped*)

Known workarounds

Restart Visual Studio.

Related information

  • Operating system: Windows 10 AU
  • Branch: master
  • Database versions and sample databases being used: Doesn't matter
  • Editing Tools: Visual Studio 2015

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions