Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#344 Only include STJ for Net Standard 2 #367

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

thompson-tomo
Copy link
Contributor

@thompson-tomo thompson-tomo commented Apr 7, 2024

Has added in Net 6 which has STJ so no need for dependency

Closes #344

@doghappy
Copy link
Owner

doghappy commented Apr 8, 2024

Thanks for you PR, but I don't know why need to change, could you please leave extra infos to explain it?

@thompson-tomo
Copy link
Contributor Author

when a library is compiled for a particular framework ie Net 6 a number of dependencies are provided by the framework hence the developer/publisher is not needing to include them in their release for those frameworks.
In this case System.text.Json is bundled in to the Framework starting with Net core 3 hence when compiling for those newer framework's ie Net 6 you don't need that dependency hence why the condition results in it only be included for Net standard 2 where isn't part of the framework.

@doghappy
Copy link
Owner

doghappy commented Apr 22, 2024

I have published 2 packages to local folder, and then make the folder as a nuget source.

  • SocketIO.Serializer.SystemTextJson v3.1.2-alpha.1
  • SocketIO.Serializer.SystemTextJson v3.1.2-alpha.2

the condition of alpha.1 is

  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
    ...
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="System.Text.Json" Version="8.0.3" />
  </ItemGroup>

the condition of alpha.2 is

  <PropertyGroup>
    <TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
    ...
  </PropertyGroup>
  <ItemGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
    <PackageReference Include="System.Text.Json" Version="8.0.3" />
  </ItemGroup>

next I created a .NET8 ConsoleApp and installed SocketIO.Serializer.SystemTextJson from local source instead of nuget.org, the following screenshot is alpha.1

ConsoleApp1
image

then I removed the alpha.1 and install the alpha.2

ConsoleApp1
image

How to test the differences between them?

commit: e9dcb3c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.net 6.0 System.Text.Json conflict
2 participants