2016-03-09
| ||
13:58 | • Ticket [da685c0bac] GetXmlConfigFileName should check for invalid directory status still Closed with 3 other changes artifact: 79a556281f user: anonymous | |
02:39 | • Ticket [da685c0bac]: 3 changes artifact: 190579852f user: mistachkin | |
02:38 | • Closed ticket [da685c0bac]. artifact: b58e186c05 user: mistachkin | |
01:20 | Add test for ticket [da685c0bac]. check-in: 2b1ca5ca01 user: mistachkin tags: trunk | |
2016-03-08
| ||
23:17 | • Ticket [da685c0bac] GetXmlConfigFileName should check for invalid directory status still Pending with 4 other changes artifact: 62489933e2 user: mistachkin | |
23:16 | Avoid using Path.Combine with null values in the native library pre-loader. Fix for [da685c0bac]. check-in: 61eafc5985 user: mistachkin tags: trunk | |
23:12 | • Ticket [da685c0bac] GetXmlConfigFileName should check for invalid directory status still Pending with 3 other changes artifact: 35405b0f17 user: mistachkin | |
22:51 | • Ticket [da685c0bac]: 3 changes artifact: cfa15da629 user: mistachkin | |
22:43 | • Pending ticket [da685c0bac]. artifact: e9c34248c2 user: mistachkin | |
21:26 | • New ticket [da685c0bac]. artifact: 31fe3e248a user: anonymous | |
Ticket Hash: | da685c0bacca97c43bde3f00c7f03d3b4ecf1ac5 | ||
Title: | GetXmlConfigFileName should check for invalid directory | ||
Status: | Closed | Type: | Code_Defect |
Severity: | Important | Priority: | Medium |
Subsystem: | Native_Library_PreLoader | Resolution: | Fixed |
Last Modified: | 2016-03-09 13:58:43 | ||
Version Found In: | 1.0.99 |
User Comments: | ||||
anonymous added on 2016-03-08 21:26:54:
When bundling the System.Data.Sqlite libraries using something like Costura.Fody, the code to retrieve the Xml configuration file repeatedly fails since the directory of the assembly cannot be determined. The trace output has many messages like: Native library pre-loader failed to get setting "No_PreLoadSQLite" value: System.ArgumentNullException: Value cannot be null. Parameter name: path1 at System.IO.Path.Combine(String path1, String path2) at System.Data.SQLite.UnsafeNativeMethods.GetXmlConfigFileName() at System.Data.SQLite.UnsafeNativeMethods.GetSettingValue(String name, String default) Since UnsafeNativeMethods.GetAssemblyDirectory can return null in several code paths, UnsafeNativeMethods.GetXmlConfigFileName should check for null before passing the path to Path.Combine. This would avoid many repeated null reference exceptions. mistachkin added on 2016-03-08 23:12:07: The set of circumstances where the directory value can be null is extremely small. Is this issue on the .NET Compact Framework? Meanwhile, I'm working the fix now. There does not appear to be an easy way to test it. Are you able to confirm the fix in your environment? mistachkin added on 2016-03-08 23:17:16: Candidate fix on trunk, please let us know if it works to resolve the issue in your environment. mistachkin added on 2016-03-09 02:39:28: Test added by check-in [2b1ca5ca01d6ddb6]. anonymous added on 2016-03-09 13:58:43: That fix worked; I no longer see the exceptions being thrown. Thanks for such a quick turn-around, I hope to see the fix in 1.0.100! I agree there are a small number of scenarios were it would be null, but I'm in one of them now. I'm using Costura to embed the System.Data.SQLite assemblies into my assembly to make distribution of it easier. This tutorial gives an example of doing this. Costura works by embedding dependent assemblies as resources, then when they need to be resolved they are extracted as streams and loaded via Assembly.Load (see this link for the code). Since the assembly comes from a stream, it has no location on disk and so GetAssemblyDirectory returns null. |