Announcing the Salesforce Toolkits for .NET

Salesforce provides programmatic access to your organization’s information using simple, powerful, and secure application programming interfaces (APIs). APIs open up a platform to developers and enable them to explore different ways to integrate platform capabilities within their own applications.

To simplify the life of the developer, many APIs are accompanied by software development kits (commonly called SDKs) and toolkits that provide libraries and resources for interacting with the API. Some good examples for Salesforce are the Salesforce Mobile SDK (for Native, Hybrid, and HTML5) and the JavaScript REST Toolkit. These resources make it easier for developers take advantage of the platform APIs.

Until recently, all that was available to developers using the Microsoft .NET Framework – and consequently building applications for Windows, Windows Phone, and even Silverlight – were the APIs themselves. We love .NET developers (I’m one myself), and there is a large constituent of .NET developers within the Salesforce community. That’s why we’re proud to announce that last week we released the Salesforce Toolkits for .NET, specifically targeting the REST APIs and the Chatter APIs.

The Salesforce Toolkits for .NET provide native libraries for interacting with Salesforce APIs, including the REST API and Chatter API. These toolkits make it super simple to consume services from Salesforce within .NET applications by packaging them up as NuGet packages, thus handling deployment and versioning. These toolkits give .NET developers the ability to take their expertise and skills and apply it to a whole new set of applications that are built on Salesforce while also letting them integrate Salesforce better into their existing applications.

The toolkit is comprised of the following:

  • A set of native libraries for the Microsoft .NET Framework.
  • NuGet packages for easy deployment and versioning.
  • Sample applications to get you started.

Design Principles

There were a few key design principles followed when designing and building these toolkits:

  1. Provide support for as many modern Microsoft platforms as possible with the same core library. To accomplish this, the toolkits makes use of Portable Class Libraries to enable use on the following platforms: Windows 7 (.NET 4, .NET 4.5), Windows 8, Windows Phone 8, and Silverlight 5.
  2. Avoid performance bottlenecks and application blocking. To accomplish this, the toolkits make use of the Async and Await pattern for asynchronous programming.
  3. Allow developers to take advantage of dynamic objects so that they don’t necessarily have to create classes to represent every Salesforce object.
  4. Provide the support for key operations and enable the community participate in active development of the toolkits. You will see that our policy for contributions is extremely permissive – we want you to participate!
  5. Use NuGet packages as the primary delivery mechanism while allowing access to the underlying source code. Furthermore, give developer’s access to the latest development/test packages.

Where Can I Find the Bits?

You can find all the source code in Github:

The NuGet packages are published here:

How Do You Get Started?

The easiest way to get started today is to use the NuGet packages.

Install-Package DeveloperForce.Force

Install-Package DeveloperForce.Chatter

Take a look at the repositories and review some of the sample code that shows you how to generate access tokens, make Force.come REST API calls, and use the Chatter API. You can take a look at the available sample applications and I also recommend reviewing the functional tests and Chatter functional tests for insight into the libraries.

Take a look at two great posts from members of the community:

What’s Next?

There is certainly more to do. Here’s a short list of additional ideas (not necessarily prioritized):

  1. Continue to provide more support for API operations. We’re only scratching the surface today.
  2. Visual Studio extension for interacting with Salesforce.
  3. Lots more samples. If you’re at all interested in getting involved, this is a great way. I’d love to work with you.
  4. Support for other APIs, such as the Streaming API, SOAP API, Toolking API, and so on.
  5. Webinars and hackathons for .NET developers.
  6. Lots more blogging and discussion about the toolkits and how to use them.

At the end of the day, the purpose of the Salesforce Toolkits for .NET is to make it easier for .NET developers to build amazing applications using .NET and Salesforce. This release is just the first step; there’s certainly more to do, and a lot of opportunity for you to get involved.

tagged , , , , , Bookmark the permalink. Trackbacks are closed, but you can post a comment.
  • This will be a very good source of knowledge so that we can best exploit the useful information for me. Thanks for the list that you gave us, not bad at all. Really thank you, look forward to sharing more from you.

  • gmart

    Thanks for this. Is there a tutorial for getting started?

    • Wade Wegner

      I plan to write a few tutorials. What in particular would help you?

      • gmart

        That would be cool! My initial specific need concerns registration for events. One of my clients uses Salesforce. We use a standalone conference registration form and I would like to be able to update their database to indicate which contacts registered for the event. I was thinking to use the customer’s email address and via API update Salesforce, but I don’t know where to begin.

  • jv

    Thanks a lot. I get this error “Could not load type ‘Salesforce.Common.SalesforceHttpClient’ from assembly ‘Salesforce.Common, Version=, Culture=neutral, PublicKeyToken=null’.” with ChatterClient

  • Thanks for the info the info and tools will come in handy!

  • martinezj

    I created a windows app and get “authentication failure – Failed: API security token required” I went to -> App Setup -> Apps. I created a new “Connected Apps” and enabled OAuth settings. I’m a bit confused, since it is asking for a Callback URL. Did I do something wrong if I want to create a windows or console app? BTW, great job on the .net SDK. Cant wait to get this setup and running.

    • martinezj

      Never mind, I figured it out. I needed to append my security token to my password.

      • Wade Wegner

        Glad you figured this out! I can’t wait to hear about the apps you’ll build.

        • martinezj

          Hello Wade. I’m able to connect to my production data with no problem. I’m having difficulty connecting to my sandbox. Is there anything different I need to do?

  • Thanks Wade Wagner. It is indeed useful SDK for .Net developers. Is it your personal open source project or is it officially released from Salesforce? Reason for asking is that every quarter Salesforce add new features which may cause changes in API, so will Salesforce also release new version of toolkit quarterly (if it is necessary)? I mean how can we trust this SDK stay updated and synched with new versions?

    • Wade Wegner

      Glad you find this useful!

      This toolkit, and you as a developer, have my full support and the support of the Developer Relationships team here at Salesforce. We purposeful open sourced this toolkit so that, with your help, we keep up with all API releases and updates.

      Keep us honest, and if you find things don’t work or you’re having trouble, let us know. Our job is to make it easier for you to build great applications on the platform.

      • Tim Marcovecchio


        We are developing an integration for a client using the toolkit (who is also running the SF Foundations Non Profit Starter Pack 3.0). We’ve run into a snag with a Non Selective Query Error. Initially we though the error was being generated inside the Non-Profit Starter Pack 3.0. The chief developer their seems to think the issue is inside the .NET toolkit. How do you I put you in touch with our developers using the toolkit so that they can describe how we are using the toolkit for our integration? We’re stuck unless we can get some toolkit support. Thanks

  • jayinatlanta

    Here’s a Windows Phone project using the Microsoft template as closely as possible, with basic parts of the Toolkit incorporated. Heavily commented including how to get up and running with a developer environment.
    Windows Store project would be extremely similar.

    • Wade Wegner

      (I thought I had replied to this already but it’s mysteriously gone!)

      This is great to see, Jay! I missed this comment and built my own sample for Windows Phone 8 too: Take a look, as I use the User-Agent auth flow which doesn’t require putting secrets (either Username/Password or ConsumerKey/ConsumerSecret) on the device.

      Looking forward to learning more from your sample. Thanks again!

      • jayinatlanta

        Good, Wade. I’m sure yours is a lot more enlightening, and glad you used the other auth flow. It’s never my favorite (including from doing some jumpstarts at Dreamforce), but it’s wise.

        I was attending a Microsoft modern apps session today and thought that an ASP.NET SPA sample would be a good thing to have also. I was releasing a Windows Store example next, but I think VS 13 has a bug for the out-of-box Windows Store template… so if I get a chance, I might do the SPA with the user/agent flow.

        • Wade Wegner

          The SPA sample idea is fantastic! If you build it I’d be happy to include it in toolkit (giving you full credit, of course)!

  • Justin Helgerson

    Good to see a little more interest in the REST API. Does the current state of this help out with child relationships as well? It would be nice to be able to query data and have not only the top level object’s properties populated, but the children objects as well (e.g. query accounts and contacts).

    • Wade Wegner

      This shouldn’t be too hard to do.

  • melaugui

    Thanks a lot, I’m currently working on a Windows Phone 8 app with REST API, so this SDK is good to see !

  • It’d be pretty cool if you built a Linq-to-SOQL implementation that I could write terse LINQ queries instead of passing strings around.

    • Wade Wegner

      A lovely idea. Want to start an open-source project for us to all contribute to? =)

  • Keattisak Chinburarat

    Great news!!!!!

  • sivavarri

    Hello Mr.Wade,

    I’m getting error like ” Unable to resolve dependency ‘Microsoft.Bcl (≥ 1.1.6)’ ” when am trying to install Nuget package in visual studio 2012 for windows phone. Please help me how can i resolve this problem ?

    Thank you

  • Sara Morgan

    Just wanted you to know that I was able to do a benchmark test of the
    new toolkit compared to the old API. I am sure you will not be surprised
    to hear that the new method is much faster (duh), which to me is one of it’s great selling points.
    The results were published on my blog here:

  • Tutorial using the DeveloperForce.Force NuGet Package

  • Amit

    can this toolkit be used for making SOAP API calls from C#.
    Currently we use enterprise wsdl but maintenance is pain.

  • Chris Harrington

    Question: Are there any samples of how to use the Chatter API with these libraries? I want to do something relatively simple like create a new post in a specific chatter group via the API, but I can’t seem to find any examples. Thanks!

  • PongGod

    Hi, Wade. I keep getting an error, “expired access/refresh token”, whenever I try to authenticate. Before trying this, I did log into my Salesforce account to reset my security token so I’m really not sure what to try next. FWIW, I’m pretty much a complete novice when it comes to the whole Salesforce platform.

    • PongGod

      BTW, I was able to overcome this error by using the UsernamePasswordAsync() overload which accepts the tokenRequestEndpointUrl parameter.

  • Vilius Cicėnas

    This is nice toolkit, but it’s documentation is seriously lacking, and I’ll say soorry for the long comment in advance. It is still mystery how to do some simple actions, beyond getting data or adding. If you want to do something little more complex, you don’t even know if it is possible with this toolkit or it just isn’t documented. For example, even such task as getting all available fields of object (Lead) is still mystery to me if it can be done, as every example I can find shows you how to query things when you already know what fields you need. I’ve chosen to try this method instead of WSDL hoping it would be more dynamic, and it would give more object oriented “power” and capabilities. Hope in future it will be improved (or better documented).

  • Bam Azizi

    First off, thanks for sharing this

    I have two questions:
    1- Why in win8Oauth sample user just puts username and password but in webserverOAuthFlow sample user needs to provide consumerKey ? What is the difference if both using OAuth 2

    2- In my application I need to read User names and Ids and in some cases edit or add users. I wonder what happens if my customer has many users e.g 10000 users? How many records could be read in one http request? Do you suggest Bulk API for that?

    appreciate your help!


  • Raghav Thakur


    Can we create the client just by the username and password. In the normal Rest API we can get the session ID based on that but it seems the constructor here requires the access token for which I would require the consumer key and secret. Please help

  • Raghav Thakur

    This works really great. Just wanted to know how can we use this sdk to convert lead into accounts.


  • Rolf Herbert

    Can anyone provide or describe how to use the username password authentication? I am not able to use the consumer or secret key for this mini app. Documentation seems very thin on the ground.


  • Ankur Gupta

    Hi wade

    I’m getting error like ” Unable to resolve dependency ‘Microsoft.Bcl (≥ 1.1.6)’ ” when am trying to install Nuget package in visual studio 2012 for outlook addin.
    Please help me how can i resolve this problem ?