roslyn icon indicating copy to clipboard operation
roslyn copied to clipboard

SQLitePCL.Batteries_V2.Init() call is throwing exception we don't handle

Open jasonmalinowski opened this issue 5 years ago • 9 comments

Seen while debugging:

image

It's throwing a FileNotFound. That catch block is not taken; we eat the exception higher up. If nothing else this means TryInitializeLibraries() is throwing rather than returning a boolean.

Did we upgrade and not correctly deploy it? @CyrusNajmabadi?

jasonmalinowski avatar Feb 11 '21 01:02 jasonmalinowski

Why you don't catch and log all regardless of the exception type?

Youssef1313 avatar Feb 11 '21 10:02 Youssef1313

I'm seeing the same sort of file not found exception when using microsoft.data.sqlclient https://github.com/dotnet/roslyn/issues/51054

NealCallaghan avatar Feb 11 '21 20:02 NealCallaghan

@NealCallaghan: that's unrelated.

jasonmalinowski avatar Feb 11 '21 21:02 jasonmalinowski

@jasonmalinowski I'm not so sure, different files and assembles but the exception type and message are exactly the same. FileNotFound could not load file or assembly.

These both happen only in generators, when used in regular runtime code these exceptions don't occur.

There is something going on with generators and referencing assemblies.

NealCallaghan avatar Feb 11 '21 21:02 NealCallaghan

@jasonmalinowski I would be interested in seeing the stack trace from the exception.

NealCallaghan avatar Feb 11 '21 22:02 NealCallaghan

The case for this bug has nothing to do with generators; Roslyn uses SQLite as a caching engine and an upgrade went wrong.

jasonmalinowski avatar Feb 11 '21 22:02 jasonmalinowski

@jasonmalinowski I'm sorry I didn't know that. Thank you for sharing.

NealCallaghan avatar Feb 12 '21 08:02 NealCallaghan

@NealCallaghan Not a problem! I just didn't want you getting excited that when we closed this to expect your issue was fixed too.

jasonmalinowski avatar Feb 12 '21 18:02 jasonmalinowski

Fixed with https://github.com/dotnet/roslyn/pull/51167

CyrusNajmabadi avatar Feb 17 '21 19:02 CyrusNajmabadi