Comments (11)
Ok, it seems there are multiple issues and all of them addressed now:
-
The new Npgsql (or Postgers 16) had changed the mapping from array_dimensions from int32 to int16 (short). That caused "Invalid cast exception". I had to release new version of SQLProvider 1.3.24 to fix that.
-
Npgsql had added also dependency to System.Text.Json which was not clear from the error-message.
-
Your editor (e.g. Visual Studio 2022) might run on .NET Framework 4.7.2 even if you are developing to .NET 8.0. (It's just because VS is an old program.) For that reason, you need to select your ResolutionPath files as netstandard2.0 versions of files. Get them e.g. from your Nuget cache folder. Net Framework 4.7.2 is compatible with .NET Standard 2.0. But don't worry, they are just design-time usage for VS. The runtime execution time is whatever you are developing to (e.g. .NET 8.0). This is because type-provider does operate both on runtime and design-time/compile-time.
By addressing these issues, you should be able to run SQLProvider on your .NET 8.0 project with all the latest referencies.
If you are interested of a working zip-file, having a readme.md how I made it, it's here:
myTest.zip
from sqlprovider.
Thank you for this. I didn't realize the linter might not react when I change the resolutionPath. It requires an IDE restart, which made it unclear what I was doing was working.
I ended up not needing anything except Microsoft.Extensions.Logging.Abstractions
in my resolutionPath (not even Npgsql.dll
) and the 8.0 version was fine for Rider. Maybe I'll try the framework for Visual Studio but I don't need it. You can close this now.
from sqlprovider.
Also experiencing this on windows
from sqlprovider.
This is probably because Postgres driver is loaded via reflection and they have added dependency to a component, in this case Microsoft.Extensions.Logging.Abstractions.
Two possible fixes to try;
- Set ResolutionPath static parameter and add the missing dll to the path it's pointing to. https://fsprojects.github.io/SQLProvider/core/parameters.html#ResolutionPath
- Or, add that the corresponding NuGet package reference (Microsoft.Extensions.Logging.Abstractions) to your project.
from sqlprovider.
I did both of these and it still doesn't work. Now, for the resolution path, do I want it pointing to the folder with Npgsql.dll? One that I installed with nuget?
from sqlprovider.
You have to point ResolutionPath to a folder where you have copied the reference dlls, so not only Npgsql.dll but also the missing (Microsoft.Extensions.Logging.Abstractions.dll).
from sqlprovider.
Yes, I have done this but it still doesn't work
from sqlprovider.
Which version of Npgsql started the issue? I guess 6.0.10 didn't had the issue?
from sqlprovider.
Which version of Npgsql started the issue? I guess 6.0.10 didn't had the issue?
It doesn't matter what version of Npgsql I use. I have removed the resolution path for now because it wasn't making a difference. I can send a zip of the project if that would be helpful
from sqlprovider.
This is a different error. Another one was about dotnet.exe and Microsoft.Extensions.Logging.Abstraction.dll missing.
This is about System.Runtime where it seems your VS is running on .NET Framework 4.7.2 and your references are .NET 6.0.
from sqlprovider.
This is a different error. Another one was about dotnet.exe and Microsoft.Extensions.Logging.Abstraction.dll missing.
This is about System.Runtime where it seems your VS is running on .NET Framework 4.7.2 and your references are .NET 6.0.
Yes I'm getting different linting errors depending on using Visual Studio vs Jetbrains Rider.
My program.fs file is targeting 8.0, and my references don't have anything about .NET framework.
Would you be willing to send me a zip of a starter where this is working and just let me change the connection string? I have put the DLLs in a folder and set the resolution path but I can't for the life of me get it working.
from sqlprovider.
Related Issues (20)
- MSSQL stored procedures does not correctly works with schemas
- SQLProvider + PostgreSql works with Rider and VSCode but not visual studio 2022
- Incorrect FROM statement is produced when a table name contains periods HOT 2
- [Question] How to use Pragma with SQLITE? HOT 6
- Simple group by query with postgresql causes doubling up of double quotes when using double quoted declared fields HOT 3
- OnConflict implementation for SQLite provider uses wrong feature of SQLite HOT 3
- `SqlRuntime.DataContext.addCache` timeout on first query when application starts HOT 8
- Auto-generate types by `dotnet publish` time HOT 3
- dotnet 8.0.100-preview.6.23330.14 error. HOT 12
- Performance in SQL Server when comparing `varchar` column against `string` parameter HOT 23
- Is it possible to pull down a partial row and then update it? HOT 1
- Migration guide to 1.3.x HOT 3
- Could not load file or assembly 'Microsoft.Extensions.Logging.Abstractions, Version=8.0.0.0 HOT 24
- OnConflict.Update ignores None/ValueNone values when using DatabaseProviderTypes.POSTGRESQL
- SQLite Provider using Microsoft.Data.Sqlite library does not perform updates transactionally HOT 7
- SQLite provider ResolutionPath fail HOT 8
- Support for DuckDB HOT 2
- Error in simple SQLProvider project. 'dataContext' does not define the field Main. HOT 6
- Does `join` supports the `or` operator? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sqlprovider.