Skip to content

Commit 4e0bc7b

Browse files
committed
Update target frameworks for broader compatibility and add System.Text.Json package
1 parent 2235339 commit 4e0bc7b

5 files changed

Lines changed: 21 additions & 13 deletions

File tree

Directory.Packages.props

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
1111
</ItemGroup>
1212

13+
<!-- Core Libraries (for .NET Standard support) -->
14+
<ItemGroup>
15+
<PackageVersion Include="System.Text.Json" Version="8.0.5" />
16+
</ItemGroup>
17+
1318
<!-- Microsoft Extensions -->
1419
<ItemGroup>
1520
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.0" />

src/CountryData.Globalization.Hosting/CountryData.Globalization.Hosting.csproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<!-- Target Frameworks - Modern .NET -->
5-
<TargetFrameworks>netstandard2.1;net8.0;net9.0;net10.0</TargetFrameworks>
4+
<!-- Target Frameworks - Broad compatibility (.NET Standard 2.0 works with .NET Framework 4.6.1+, .NET Core 2.0+, Unity, Xamarin) -->
5+
<TargetFrameworks>netstandard2.0;net6.0;net8.0;net10.0</TargetFrameworks>
66
<LangVersion>latest</LangVersion>
77
<ImplicitUsings>enable</ImplicitUsings>
88
<Nullable>enable</Nullable>
@@ -46,7 +46,8 @@ Initial release v1.0.0:
4646
- AddCountryData() extension method
4747
- Singleton lifetime management for ICountryDataProvider
4848
- Full ASP.NET Core integration support
49-
- Multi-framework support (.NET Standard 2.1, .NET 8-10)
49+
- Multi-framework support (.NET Standard 2.0+, .NET 6, 8, 10)
50+
- Works with .NET Framework 4.6.1+, .NET Core 2.0+, Unity, Xamarin
5051
</PackageReleaseNotes>
5152

5253
<!-- Package Icon (uncomment when you add an icon) -->

src/CountryData.Globalization/CountryData.Globalization.csproj

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<!-- Target Frameworks - Modern .NET -->
5-
<TargetFrameworks>netstandard2.1;net8.0;net9.0;net10.0</TargetFrameworks>
6-
<LangVersion>latest</LangVersion>
4+
5+
<TargetFrameworks>netstandard2.0;net6.0;net8.0;net10.0</TargetFrameworks>
6+
\ <LangVersion>latest</LangVersion>
77
<ImplicitUsings>enable</ImplicitUsings>
88
<Nullable>enable</Nullable>
99

@@ -49,8 +49,9 @@ Initial release v1.0.0:
4949
- Full CultureInfo and RegionInfo integration
5050
- O(1) dictionary lookups with lazy-loaded caches
5151
- Thread-safe operations with immutable data collections
52-
- Zero external dependencies
53-
- Multi-framework support (.NET Standard 2.1, .NET 8-10)
52+
- Minimal external dependencies (only System.Text.Json)
53+
- Multi-framework support (.NET Standard 2.0+, .NET 6, 8, 10)
54+
- Works with .NET Framework 4.6.1+, .NET Core 2.0+, Unity, Xamarin
5455
- Built-in dependency injection support via CountryData.Globalization.Hosting package
5556
</PackageReleaseNotes>
5657

@@ -97,6 +98,7 @@ Initial release v1.0.0:
9798

9899
<!-- Package References from Central Package Management -->
99100
<ItemGroup>
101+
<PackageReference Include="System.Text.Json" />
100102
<PackageReference Include="MinVer" PrivateAssets="All" />
101103
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
102104
</ItemGroup>

src/CountryData.Globalization/Models/Country.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@
22
{
33
/// <summary>
44
/// Represents a country with its associated data including ISO codes, names, phone codes, regions, and Unicode emoji flag.
5-
///
5+
///
66
/// </summary>
77
public class Country
88
{
99
/// <summary>
1010
/// Gets or sets the full country name (e.g., "United States", "Canada", "Japan").
1111
/// </summary>
12-
public required string CountryName { get; set; }
12+
public string CountryName { get; set; } = string.Empty;
1313

1414
/// <summary>
1515
/// Gets or sets the international phone code for the country (e.g., "+1", "+44", "+81").
1616
/// </summary>
17-
public required string PhoneCode { get; set; }
17+
public string PhoneCode { get; set; } = string.Empty;
1818

1919
/// <summary>
2020
/// Gets or sets the ISO 3166-1 alpha-2 country code (e.g., "US", "CA", "JP").
2121
/// </summary>
22-
public required string CountryShortCode { get; set; }
22+
public string CountryShortCode { get; set; } = string.Empty;
2323

2424
/// <summary>
2525
/// Gets or sets the Unicode emoji flag representing the country (e.g., "🇺🇸", "🇨🇦", "🇯🇵").

src/CountryData.Globalization/Models/Region.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public class Region
88
/// <summary>
99
/// Gets or sets the full region name (e.g., "California", "Ontario", "Tokyo").
1010
/// </summary>
11-
public required string Name { get; set; }
11+
public string Name { get; set; } = string.Empty;
1212

1313
/// <summary>
1414
/// Gets or sets the region short code (e.g., "CA", "ON", "13").

0 commit comments

Comments
 (0)