Rate this page:

Twilio SDK for C# and .NET

The Twilio C# / .NET SDK makes it easy to interact with the Twilio API from your .NET application. The most recent version of the library can be found on NuGet. The Twilio C# SDK supports .NET applications written in C#, VB.Net, and F# that utilize .NET Framework 3.5 or above or any supported version of .NET Core (.NET Standard v1.4).

Install the Library
When your phone number receives an incoming message or phone call, Twilio will send an HTTP request to your .NET application
Twilio servers
Your .NET app tells Twilio how to respond (e.g. with a text message, phone menu, etc.)
Your app

// Incoming message from Twilio!
var messagingResponse =
    new MessagingResponse();
messagingResponse.Message("Hello from C#!");
return TwiML(messagingResponse);
View complete examples
Twilio gets the instructions from your .NET app and takes the appropriate action
Hello from C#!

Get Started

From within Visual Studio, you can use the NuGet GUI to search for and install the Twilio NuGet package. Or, as a shortcut, simply type the following command into the Package Manager Console:

Install-Package Twilio

If you are building with the .NET Core command line tools, then you can run the following command from within your project directory:

dotnet add package Twilio

Once installed, try one of the code samples to the right or jump into one of the Quickstarts below.

Need to handle Twilio webhooks with ASP.NET MVC or ASP.NET Core? Be sure to also install the corresponding Twilio.AspNet package.

Build your App

You've got an idea in mind. Let's get it to production.

Pick the docs that are right for you. These guides, sample app tutorials, and API reference docs will get you across the deploy line, straight to HTTP 200 OK.

Full .NET SDK Reference

Dig into the Twilio API and uncover that killer feature you need to make your app awesome. The full reference details every possible method that you can use.

Common classes

There are a few common core classes used in the various tutorials and examples. They handle setting up a connection to Twilio, handling errors, and issuing security tokens for client apps.

Common REST API Resource classes

Each REST API Resource has a corresponding .NET class that you can use to create, fetch, read, update, and delete resources.

Common TwiML classes

You use TwiML to tell Twilio what to do when you are responding to a Twilio webhook (e.g. a message or a phone call).

Thank you for your feedback!

Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

Sending your feedback...
🎉 Thank you for your feedback!
Something went wrong. Please try again.

Thanks for your feedback!