Contentful logo

Contentful Community

Is there a C# SDK?

Is there a C# SDK? I know there is a .NET SDK; are they one in the same?

Hey @charlie! .NET SDK is basically for C#. Quick starts can be found here: https://www.contentful.com/developers/api-demo/dotnet/ and https://www.contentful.com/developers/docs/net/tutorials/using-net-cda-sdk/.
There is an opposite case: how to use Contentful with ASP? If you would like to do so, Contentful .NET for ASP core applications, following guide could be helpful: https://www.contentful.com/developers/docs/net/tutorials/aspnet-core/.

The .NET SDK is written in C#. It can be used from any .NET application regardless if it uses C#, F# or VB. All of the examples as Andrey is pointing out are in C# as this is the most widely used language in .NET applications, however all of the examples could be used by F# or VB with some minimal changes.

The SDK targets NetStandard 1.4 which means it can be used in .NET core, .NET full framework, Mono, Xamarin, Universal Windows Applications. As soon as .NetStandard 2.0 is released the SDK will move to target this instead which will give an even broader range of compatability.

ASP.NET is not something that is opposite to C# but simply the web framework for .NET. The Contentful.AspNetCore package is designed specifically for ASP.NET Core, which is the web framework for .NET Core applications. It is not suitable for use with regular ASP .NET, for that you would use the Contentful.Csharp package.

UPDATE:

NetStandard 2.0 has now been released and the SDK now targets this instead. This means that the range of compatibility has now increased. Any of the following platform versions (or higher) are supported:

.NET Framework 4.6.1
.NET Core 2.0
Mono 5.4
Xamarin.iOS 10.14
Xamarin.Mac 3.8
Xamarin.Android 7.5
Upcoming version of UWP (expected to ship later this year)
Upcoming version of Unity (date of release unknown)

1 Like

Thank you @robert for the great answer!
Sorry if I was not clear when I mentioned ASP.NET. I didn’t mean it’s something opposite to C#. What I meant is- if you want to use .NET SDK with something else, not with C#, what options do you have?

1 Like