Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
### Version: 3.0.0
#### Date: Jul-13-2026

##### Breaking Changes:
- Removed `Newtonsoft.Json` dependency; all JSON serialisation now uses `System.Text.Json` (BCL)
- `Entry.ToJson()`, `Query.Count()`, `AssetLibrary.Count()` now return `JsonObject` instead of `JObject`
- `AssetLibrary.Query(JsonObject)` — parameter type changed from `JObject` to `JsonObject`
- `ContentType.Fetch()`, `GlobalField.Fetch()`, `GlobalFieldQuery.Find()` now return `JsonObject` instead of `JObject`
- `SerializerSettings` → `SerializerOptions`
- Model classes use `[JsonPropertyName]` instead of `[JsonProperty]`
- Requires **.NET 10** or later
- Updated `contentstack.utils` dependency to `2.0.0` (final, non-beta)

##### Feat:
- Added `Endpoint` class for dynamic region-to-URL resolution via CDN-backed `regions.json`
- Added `ContentstackRegionMap` to map `ContentstackRegion` enum to registry region IDs
- Added `GCP_EU` region support
- Added `ApiErrorBodyParser` for consistent API error envelope parsing
- Added `JsonNodeConversion` and `JsonObjectMerge` utilities to replace Newtonsoft equivalents
- Added `ContentstackJsonDefaults` — shared `JsonSerializerOptions` used across all custom converters

##### Enh:
- `Config.BaseUrl` now resolves hosts from the regions registry; removed hardcoded `regionCode()` and `HostURL`
- Replaced `Console.WriteLine` with `Debug.WriteLine` in `ContentstackConvert` to suppress parse warnings from application stdout

##### Chore:
- Replaced `refresh-region.cs` with `refresh-region.py` — avoids MSBuild compiling the script as source
- Added `build/contentstack.csharp.targets` to auto-deliver `refresh-region.py` to consumer projects on first build
- Added `Assets/regions.json` to `.gitignore`
- Added `EndpointTest.cs`
- Updated .NET version in SCA scan CI from `7.0.x` to `10.0.x`

##### Migration Guide:
- See [Migrating from Newtonsoft.Json to System.Text.Json](https://www.contentstack.com/docs/developers/sdks/content-delivery-sdk/dot-net/migrate-dotnet-delivery-sdk-from-newtonsoft.json-to-system.text.json) for the full upgrade path from v2.x.

---

### Version: 3.0.0-beta.2
#### Date: Jun-22-2026

Expand Down
2 changes: 1 addition & 1 deletion Contentstack.Core/Contentstack.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<PackageReference Include="System.Text.Json" Version="8.0.5" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageReference Include="Markdig" Version="0.36.2" />
<PackageReference Include="contentstack.utils" Version="2.0.0-beta.2" />
<PackageReference Include="contentstack.utils" Version="2.0.0" />
<PackageReference Include="System.Net.Http" Version="4.3.4" Condition="'$(TargetFramework)' == 'net47' Or '$(TargetFramework)' == 'net472'" />
</ItemGroup>
<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion Contentstack.Core/ContentstackClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using System.Text.Json;
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
using Contentstack.Utils.Converters;

namespace Contentstack.Core
{
Expand Down Expand Up @@ -150,7 +151,7 @@ public ContentstackClient(IOptions<ContentstackOptions> options)
}

// Handles deserialization of embedded entries and assets in _embedded_items responses.
SerializerSettings.Converters.Add(new EmbeddedObjectConverter());
SerializerOptions.Converters.Add(new EmbeddedObjectConverter());
}

public ContentstackClient(ContentstackOptions options) :
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<Version>3.0.0-beta.2</Version>
<Version>3.0.0</Version>
</PropertyGroup>
</Project>
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@

This guide will help you get started with our .NET SDK to build apps powered by Contentstack.

## Prerequisites
To get started with .NET, you will need the following:

- .NET 10 or later

> **Migrating from v2.x?** Version 3.0.0 replaces Newtonsoft.Json with System.Text.Json and changes several public API return/parameter types (e.g. `Entry.ToJson()`, `Query.Count()` now return `JsonObject` instead of `JObject`). See the [migration guide](https://www.contentstack.com/docs/developers/sdks/content-delivery-sdk/dot-net/migrate-dotnet-delivery-sdk-from-newtonsoft-to-stj) before upgrading.

## SDK Installation and Setup

To use the .NET SDK, download it from here
Expand Down Expand Up @@ -99,6 +106,31 @@ query.Find<Product>().ContinueWith((t) => {
}
});
```
## Endpoint Resolution

Use the `Endpoint` class to resolve Contentstack service URLs for any supported region without hardcoding hosts. This is useful when configuring `ContentstackOptions` for a specific region, including the newly added `gcp-eu` region.

``` cs
using Contentstack.Core.Endpoints; // Endpoint

// Resolve the Content Delivery endpoint for a region
string url = Endpoint.GetContentstackEndpoint("us", "contentDelivery");
// → "https://cdn.contentstack.io"

// GCP-EU region support
string gcpEuUrl = Endpoint.GetContentstackEndpoint("gcp-eu", "contentDelivery");

// Strip the https:// scheme — useful when passing the host directly to SDK configuration
var options = new ContentstackOptions()
{
ApiKey = "<api_key>",
DeliveryToken = "<delivery_token>",
Environment = "<environment>",
Host = Endpoint.GetContentstackEndpoint("eu", "contentDelivery", omitHttps: true)
};
ContentstackClient stack = new ContentstackClient(options);
```

## API Reference
Go through our .NET SDK API Reference guide to know about the methods that can be used to query your content in Contentstack.

Expand Down
Loading