.NET additional topics


Cloudinary is a cloud-based service that provides an end-to-end image and video management solution including uploads, storage, administration, image manipulation, and delivery.

Cloudinary's .NET library wraps Cloudinary's upload API for easily uploading images, videos and raw files to the cloud. In addition, the .NET library simplifies the generation of manipulation URLs and includes view helper methods for embedding transformed images and videos in your web views.

This page includes additional details regarding the integration of Cloudinary with your .NET applications.

Configuration options

Setting the configuration parameters can be done either programmatically using appropriate constructor of Cloudinary class or globally using an environment variable.

Your CloudName account parameter is required to build image URLs. Your APIKey and APISecret are further needed to perform secure API calls to Cloudinary (e.g., image and video uploads). See Account and API setup for more details.

You can find your configuration parameters in the dashboard of our Management Console.

Here's an example of setting configuration parameters in your .NET application:

Account account = new Account(
Cloudinary cloudinary = new Cloudinary(account);

Another configuration option allows you to dynamically configure the Cloudinary library by defining the CLOUDINARY_URL environment variable. The configuration URL is available in the Management Console's dashboard of your account. When using Cloudinary through a PaaS add-on (e.g., AppFog), this environment variable is automatically defined in your deployment environment. Here's a sample value:


In addition to the three mandatory configuration parameters mentioned above, you can define various optional configuration parameters either globally (using appropriate public fields of an instance of Api class or for each API call specifically using methods of Url class. Optional parameters:

  • CSubDomain - Boolean (default: false). Whether to automatically build URLs with multiple CDN sub-domains. See this blog post for more details.
  • PrivateCdn - Boolean (default: false). Should be set to true for Advanced plan's users that have a private CDN distribution.
  • SecureDistribution - The domain name of the CDN distribution to use for building HTTPS URLs. Relevant only for Advanced plan's users that have a private CDN distribution.
  • CName - Custom domain name to use for building HTTP URLs. Relevant only for Advanced plan's users that have a private CDN distribution and a custom CNAME.
  • Secure - Boolean (default: false). Force HTTPS URLs of resources even if embedded in non-secure HTTP pages.

Admin API

While using Cloudinary, all your images and videos are uploaded to the cloud. You can use our Media Library web interface to browse through your uploaded media assets and generated transformations.

In addition, you can use Cloudinary's administrative API: an intuitive RESTful HTTP API for programmatically managing all of your Cloudinary hosted assets. Main supported operations:

  • Listing all uploaded images, videos and raw files.
  • Receiving details and metadata for uploaded media assets, including timestamps, format, dimensions, etc.
  • Listing the derived versions of uploaded resources.
  • Finding all resources that share a given tag.
  • Listing all transformations.
  • Listing tags.
  • Receiving transformation details.
  • Creating named transformations.
  • Updating an existing transformation.
  • Deleting resources, derived resources and transformations.

For example, the following .NET command returns the details of an uploaded image according to its public ID (all details will be deserialized into instance of GetResourceResult class):

var account = new Account(
var cloudinary = new Cloudinary(account);
var getResult = cloudinary.GetResource("sample");
* RESPONSE (GetResourceResult):
* {
*  "public_id":"sample",
*  "format":"jpg",
*  "version":1375283820,
*  "resource_type":"image",
*  "type":"upload",
*  "created_at":"2017-07-31T15:16:53Z",
*  "bytes":759100,
*  "width":1920,
*  "height":1200,
*  "url":"http://res.cloudinary.com/.../upload/v1375283820/sample.jpg",
*  "secure_url":"https://res.cloudinary.com/.../upload/v1375283820/sample.jpg",
*  "next_cursor":"fe2b0ab2d84c668edaa38d9a528884c8",
*  "derived":[
*  {
*    "transformation":"w_10/a_10/png",
*    "format":"png",
*    "bytes":432,
*    "id":"e76bf3dcb7bb81aa7f5a34a5a90ed2b3",
*    "url":"http://res.cloudinary.com/.../upload/w_10/a_10/v1375283820/sample.png",
*    "secure_url":"https://res.cloudinary.com/.../upload/w_10/a_10/v1375283820/sample.png"
*  },
*  {
*    "transformation":"w_100",
*    "format":"jpg",
*    "bytes":3434,
*    "id":"94a81bec64d7ac730febfe84595ff23d",
*    "url":"http://res.cloudinary.com/.../upload/w_100/v1375283820/sample.jpg",
*    "secure_url":"https://res.cloudinary.com/.../upload/w_100/v1375283820/sample.jpg"
*  }]
* }

For a general overview and more examples, see this blog post: RESTful API for managing your website's images and other online assets

For more details, see our complete reference of the Admin API.