ericsink / SQLitePCL.raw

A Portable Class Library (PCL) for low-level (raw) access to SQLite
Apache License 2.0
512 stars 106 forks source link

Bug in the CodePath from the changes of new Uri #595

Open kwangchoiaderant opened 2 months ago

kwangchoiaderant commented 2 months ago

What version of SQLitePCLRaw are you using? 2.1.8.2226

If you are using one of the SQLitePCLRaw bundle packages, which one? Microsoft.Data.Sqlite.Core

What platform are you running on? What operating system? Which version? What CPU? Windows 10

What target framework are you building for?

Are you on .NET Framework or the newer stuff (.NET Core, .NET 5+, etc)? .NET Framework

Are you using the command line, or an IDE? Which IDE? Which version of that IDE? VS 2022

Is this problem something that just started happening? For example, were things working well for you and then you updated something and then the problem showed up? What changed?

Limit use of CodeBase to .NET Framework. · ericsink/SQLitePCL.raw@6f70157 (github.com) broke how the SQLite handles the path. GetDirectoryName will strip the backward slashes from CodeBase – as it should as Windows paths support a single backwards slash, which creates an invalid Uri as the scheme for a file uri is file:\ not file:\ and it all goes south from there.

What is the exact error message you are seeing when the problem happens? Invalid URI: The Authority/Host could not be parsed. Message: Invalid URI: The Authority/Host could not be parsed. Exception Type: System.UriFormatException Source: System Help Link: Trace: at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind) at SQLitePCL.NativeLibrary.MakePossibilitiesFor(String basename, Assembly assy, Int32 flags, LibSuffix suffix) at SQLitePCL.NativeLibrary.MyLoad(String basename, Assembly assy, Int32 flags, Action`1 log) at SQLitePCL.NativeLibrary.Load(String libraryName, Assembly assy, Int32 flags) at SQLitePCL.Batteries_V2.MakeDynamic(String name, Int32 flags) at SQLitePCL.Batteries_V2.DoDynamic_cdecl(String name, Int32 flags) Target: CreateThis

Are you using PackageReference or packages.config?

If you are using mobile platforms, are you on classic/legacy Xamarin or on .NET 6 and higher?

Sometimes other packages using SQLitePCLRaw cause problems when they are mixed together. What other packages are you including in your project?

How can we reproduce the problem you are seeing? Your issue will get attention much faster if you attach a minimal reproduction sample project.

  1. Try to create connection via UNC path