Giter Site home page Giter Site logo

Comments (11)

Thorium avatar Thorium commented on June 11, 2024 1

Ok, it seems there are multiple issues and all of them addressed now:

  1. 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.

  2. Npgsql had added also dependency to System.Text.Json which was not clear from the error-message.

  3. 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.

crimsonhawk47 avatar crimsonhawk47 commented on June 11, 2024 1

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.

crimsonhawk47 avatar crimsonhawk47 commented on June 11, 2024

Also experiencing this on windows

from sqlprovider.

Thorium avatar Thorium commented on June 11, 2024

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;

  1. 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
  2. Or, add that the corresponding NuGet package reference (Microsoft.Extensions.Logging.Abstractions) to your project.

from sqlprovider.

crimsonhawk47 avatar crimsonhawk47 commented on June 11, 2024

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.

Thorium avatar Thorium commented on June 11, 2024

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.

crimsonhawk47 avatar crimsonhawk47 commented on June 11, 2024

Yes, I have done this but it still doesn't work

from sqlprovider.

Thorium avatar Thorium commented on June 11, 2024

Which version of Npgsql started the issue? I guess 6.0.10 didn't had the issue?

from sqlprovider.

crimsonhawk47 avatar crimsonhawk47 commented on June 11, 2024

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

image
image

from sqlprovider.

Thorium avatar Thorium commented on June 11, 2024

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.

crimsonhawk47 avatar crimsonhawk47 commented on June 11, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.