GithubHelp home page GithubHelp logo

Comments (5)

slozier avatar slozier commented on July 28, 2024

No idea how you're loading your DLLs, but you're most likely using the wrong Microsoft.Data.SqlClient.dll file.

from ironpython3.

kumarKovuru avatar kumarKovuru commented on July 28, 2024

Hi @slozier @BCSharp
I am also facing the same issue, below are the steps that I tried.

Step 1: I have created a Class library project in .Net6.0
Step 2: I have installed below packages through nuget package manager
Microsoft.EntityFrameworkCore.Tools
Microsoft.EntityFrameworkCore.SqlServer
Microsoft.EntityFrameworkCore.Design
Microsoft.EntityFrameworkCore

Step 3: I have created DatabaseContext through entiryframework. i have used SQL server.
Step 4: The C# Library works fine when I tested with a Console Application.
Step 5: I am getting an error “SystemError: Microsoft.Data.SqlClient is not supported on this platform” in IronPython when i load the Class Library DLL(Step 1)

from ironpython3.

slozier avatar slozier commented on July 28, 2024

When you nuget install the package, the Microsoft.Data.SqlClient.dll that ends up in the main application folder is just a stub assembly that throws PlatformNotSupportedException on everything. The DLL you actually want is under the runtimes folder. If you look at your console application folder there's probably a <assembly name>.deps.json which .NET uses to find the correct DLL to load. This is probably why the console application works (I assume if you were to remove the deps file it'd start throwing PNSE).

from ironpython3.

kumarKovuru avatar kumarKovuru commented on July 28, 2024

Hi @slozier, Thanks for the response.
I tried the below steps but got the same error "SystemError: Microsoft.Data.SqlClient is not supported on this platform"

Step 1: Copied the folders inside the runtimes folder that are generated on publish.
Step 2: Pasted them inside the path IronPython.3.4.1\net6.0\runtimes (this is after unzip of IronPython.3.4.1)

from ironpython3.

slozier avatar slozier commented on July 28, 2024

@kumarKovuru I think you misunderstood. I was trying to explain the the .deps.json file pointing to the assemblies in the runtimes folder is required by .NET to find the correct assembly. Another option that might work would be putting the DLLs from the runtimes folder in the root - which might be fine if you don't care about the cross-platform aspect of things...

from ironpython3.

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.