peachpiecompiler / peachpie

PeachPie - the PHP compiler and runtime for .NET and .NET Core
https://www.peachpie.io
Apache License 2.0
2.31k stars 201 forks source link

Peachpie.Runtime uses outdated System.Data.SqlClient 4.6.0 #1126

Closed mhoeper closed 8 months ago

mhoeper commented 8 months ago

Hi,

using Peachpie.Runtime, depending on Peachpie.App depending on, finally Peachpie.Library.MsSql is being used. I do not even need MsSql.... Nevertheless, this has dependency to System.Data.SqlClient 4.6.0, that is outdated. Can you please upgrade to the latest version?

I am using target framework net7.0 with Peachpie.Runtime 1.1.9

jakubmisek commented 8 months ago

Hi,

Thank you for the issue;

mhoeper commented 8 months ago

Thanks Jakub for the update. Turns out i am usingPeachpie.NET.Sdk, too, so somehow even with <DisableImplicitPeachpieReferences>true</.. the System.Data.SqlClient gets linked.

Do you know this is going to be released this year?

jakubmisek commented 8 months ago

That should work, we're using it for years in production :/

Peachpie.NET.Sdk is the project build target, and it either adds a reference to Peachpie.App or not.

FYI the dependencies look like this:

Peachpie.NET.Sdk -> -> Peachpie.App -> Peachpie.Library.MsSql -> System.Data.SqlClient

Peachpie.Runtime itself does not reference any Sql assemblies.

This is the dependency tree of a compiled PHP application, with <DisableImplicitPeachpieReferences>false</DisableImplicitPeachpieReferences> (default)

image

mhoeper commented 8 months ago

Thank you, its working good now!

I was referencing Peachpie.NET.Sdk by package reference as below in msbuildproj file:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <DisableImplicitPeachpieReferences>true</DisableImplicitPeachpieReferences>  
  </PropertyGroup>  
  <ItemGroup>
    <PackageReference Include="Peachpie.NET.Sdk" Version="1.1.7" PrivateAssets="Build" />
  </ItemGroup>
</Project>

This way its still adding System.Data.SqlClient. When changing to the below, System.Data.SqlClient no longer being included...

<Project Sdk="Peachpie.NET.Sdk/1.1.9">
  <PropertyGroup>
    <DisableImplicitPeachpieReferences>true</DisableImplicitPeachpieReferences>
  </PropertyGroup>
</Project>