-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using SqliteConnection from an ASP.NET MVC (.NET Framework) application results in a few different exceptions #32614
Comments
I had to run this in order to test:
After that, I was able to repro.. something like this would fix the breaking check (but still get the catch (Exception ex)
{
if (ex is FileLoadException || ex is ArgumentException)
{
// Ignore "Could not load assembly.";
// Ignore "The parameter is incorrect."
}
else
{
throw;
}
} /cc @ericsink |
Note for triage: requires VS to investigate. |
Using native code with .NET Framework is a never-ending fountain of edge cases. |
In 7.x call In 8.x same call throws but now it's [System.ArgumentException]: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
at System.Type.GetType(String typeName)
at Microsoft.Data.Sqlite.SqliteConnection..cctor() |
…hat might not exist Since it appears that they can exist but be the wrong version for us to use. Fixes #32614
Example project from following steps below: WebApplication1.zip
Now, even if you get around that (we got around it here by doing a runtime copy of e_sqlite.dll to the shadow copy location of SQLitePCLRaw.core.DLL), you can still get exceptions (as of version 8.0.0) from the type initialization of SqliteConnection, which you can approximate (in the attached example project), but uncommenting the ApproximateSqlConnectionStaticCtor() call in HomeController.Index(). In which case, you get:
at
Include version information
Microsoft.Data.Sqlite version: 8.0.0
Target framework: net48
Operating system: Windows
The text was updated successfully, but these errors were encountered: