Back

System.PlatformNotSupportedException: System.Data.SqlClient is not supported on this platform.

  • 0
  • Self Hosted
  • Functions
Kuromory
25 Mar, 2024, 09:55

I use the the SqlClient in my c# function but I get this exception... What do I need to do so it works?

TL;DR
Developers are encountering a 'System.PlatformNotSupportedException' error when trying to use System.Data.SqlClient on a platform where it's not supported. They've tried switching to Microsoft.Data.SqlClient in their csproj file, but the issue persists. They are trying to sync data between an Appwrite database and an MSSQL database. Solution: Since System.Data.SqlClient is not supported on the current platform, developers should use Microsoft.Data.SqlClient instead for compatibility.
D5
25 Mar, 2024, 10:02

Could you give more context on what you're trying to achieve?

Kuromory
25 Mar, 2024, 10:04

I have a trigger so when create/update/delete is executed on the appwrite database I want to "sync" this to an other MSSQL database

Kuromory
25 Mar, 2024, 10:05

I also used the cli to create the function so the deloyment works just fine πŸ™‚

Kuromory
25 Mar, 2024, 10:28

I also changed to the package Microsoft.Data.SqlClient but it didn't help... here is the csproj File that I use:

TypeScript
<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <OutputType>Exe</OutputType>
    <!-- <RuntimeIdentifier>ubuntu.22.04-x64</RuntimeIdentifier> -->
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Appwrite" Version="0.8.0" />
    <PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.0" />
  </ItemGroup>
</Project>
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more