# Any interest in a .NET client for Spark Cloud API?

**URL:** <https://community.particle.io/t/any-interest-in-a-net-client-for-spark-cloud-api/2722>\
**Category:** Cloud\
**Created:** [February 9, 2014, 2:08pm UTC](https://community.particle.io/t/any-interest-in-a-net-client-for-spark-cloud-api/2722 "2014-02-09T14:08:49Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![kareem613](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/kareem613/32/1931_2.png) [@kareem613](https://community.particle.io/u/kareem613)\
**Post date:** [February 9, 2014, 2:08pm UTC](https://community.particle.io/t/any-interest-in-a-net-client-for-spark-cloud-api/2722/1 "2014-02-09T14:08:49Z")

</div>

I’ve got the basic functions working. Read values and execute functions. I’ve used it to make a Tinker client. Works like a charm for all analog and digital pins.

If there’s interest I can separate it from my project solution and put it up on git. Maybe package it up as a nuget package.

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dave/32/181_2.png) [@Dave](https://community.particle.io/u/Dave)\
**Post date:** [February 9, 2014, 3:58pm UTC](https://community.particle.io/t/any-interest-in-a-net-client-for-spark-cloud-api/2722/2 "2014-02-09T15:58:30Z")

</div>

As a C# fan myself, I think that’d be cool!

---

<div class="post-metadata">

**Author:** ![Soulhuntre](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/soulhuntre/32/2106_2.png) [@Soulhuntre](https://community.particle.io/u/Soulhuntre)\
**Post date:** [February 9, 2014, 4:15pm UTC](https://community.particle.io/t/any-interest-in-a-net-client-for-spark-cloud-api/2722/3 "2014-02-09T16:15:38Z")

</div>

Absolutely. If you want to kick it out on github I am sure some of us would be happy to use ti and possibly extent it a bit.

---

<div class="post-metadata">

**Author:** ![RickardP](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rickardp/32/20718_2.png) [@RickardP](https://community.particle.io/u/RickardP)\
**Post date:** [February 9, 2014, 4:40pm UTC](https://community.particle.io/t/any-interest-in-a-net-client-for-spark-cloud-api/2722/4 "2014-02-09T16:40:37Z")

</div>

Absolutely put it on GIthub, i going to make my own later if i dont find any, but we can have it as a open source project for the basic stuff.

---

<div class="post-metadata">

**Author:** ![kareem613](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/kareem613/32/1931_2.png) [@kareem613](https://community.particle.io/u/kareem613)\
**Post date:** [February 9, 2014, 8:37pm UTC](https://community.particle.io/t/any-interest-in-a-net-client-for-spark-cloud-api/2722/5 "2014-02-09T20:37:42Z")

</div>

Alright. Here goes. Certified Works-On-My-Machine. 🙂

> **[kareem613/SharpSpark](https://github.com/kareem613/SharpSpark)**
>
> A .NET client for the SparkCore Cloud API. Contribute to kareem613/SharpSpark development by creating an account on GitHub.

I think I have all the basics covered. Your feedback and pull requests would be appreciated.

I’m not really happy how errors are handled. Thinking of throwing exceptions.

If you want to run the TinkerClient tests, you have to have the Tinker Firmware flashed.

---

<div class="post-metadata">

**Author:** ![kareem613](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/kareem613/32/1931_2.png) [@kareem613](https://community.particle.io/u/kareem613)\
**Post date:** [February 9, 2014, 9:03pm UTC](https://community.particle.io/t/any-interest-in-a-net-client-for-spark-cloud-api/2722/6 "2014-02-09T21:03:20Z")

</div>

Just realized a decent design flaw in GetVariable vs. ExecuteFunction. Looks like this is going to need dedicated test firmware. I’ll update soon.

---

<div class="post-metadata">

**Author:** ![kareem613](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/kareem613/32/1931_2.png) [@kareem613](https://community.particle.io/u/kareem613)\
**Post date:** [February 9, 2014, 9:41pm UTC](https://community.particle.io/t/any-interest-in-a-net-client-for-spark-cloud-api/2722/7 "2014-02-09T21:41:37Z")

</div>

Ok. Should be good to go now.  
You need to flash the TestFirmware.cpp to run the SparkClientTests.  
You need to flash the Tinker app firmware to run the TinkerClientTests.

---

<div class="post-metadata">

**Author:** ![mrabie](https://avatars.discourse-cdn.com/v4/letter/m/74df32/32.png) [@mrabie](https://community.particle.io/u/mrabie)\
**Post date:** [December 28, 2014, 10:15am UTC](https://community.particle.io/t/any-interest-in-a-net-client-for-spark-cloud-api/2722/8 "2014-12-28T10:15:51Z")

</div>

Has anyone tried this with Windows Phone 8.1? I compiled the DLL, tried the same exact code with Windows Desktop app and Windows Phone 8.1. On the Windows app it works great, but from the Windows Phone 8.1 app, I get an error  
"An exception of type ‘System.IO.FileNotFoundException’ occurred in SharpSpark.DLL but was not handled in user code"  
when calling " var result = CloudPost(functionKey, args);"  
any ideas why this might be happening?

I thought maybe it’s an internet connection error, but i check for internet connectivity before calling the function.

Thanks for your help

---

<div class="post-metadata">

**Author:** ![kareem613](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/kareem613/32/1931_2.png) [@kareem613](https://community.particle.io/u/kareem613)\
**Post date:** [April 7, 2015, 3:25am UTC](https://community.particle.io/t/any-interest-in-a-net-client-for-spark-cloud-api/2722/9 "2015-04-07T03:25:41Z")

</div>

Wow. Missed this post entirely.  
My guess is it’s not built as a portable class library. It’s on my todo list.

Have you had any success since posting this?

---

<div class="post-metadata">

**Author:** ![mrabie](https://avatars.discourse-cdn.com/v4/letter/m/74df32/32.png) [@mrabie](https://community.particle.io/u/mrabie)\
**Post date:** [April 7, 2015, 8:59am UTC](https://community.particle.io/t/any-interest-in-a-net-client-for-spark-cloud-api/2722/10 "2015-04-07T08:59:30Z")

</div>

It was JSON version problem. I had to write a new code based on the WP8 JSON library.

---

<div class="post-metadata">

**Author:** ![developer\_bt](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/developer_bt/32/1311_2.png) [@developer\_bt](https://community.particle.io/u/developer_bt)\
**Post date:** [April 19, 2015, 4:16pm UTC](https://community.particle.io/t/any-interest-in-a-net-client-for-spark-cloud-api/2722/11 "2015-04-19T16:16:40Z")

</div>

Hello @kareem613!  
Will you please if you can attach a simple example of the library.  
For example reading and writing variable and function by using a windows form. So I need a simple example just a few functions.  
There are many files I do not know how to incorporate in the project. Which files should should be included in the project? Whether they could make a dll?  
I’m emebedded / HW guy 🙂  
I do not know much about C #. I’m still a beginner …  
I hope you will help me.

---

<div class="post-metadata">

**Author:** ![MasterVizz](https://avatars.discourse-cdn.com/v4/letter/m/c37758/32.png) [@MasterVizz](https://community.particle.io/u/MasterVizz)\
**Post date:** [April 30, 2015, 5:01am UTC](https://community.particle.io/t/any-interest-in-a-net-client-for-spark-cloud-api/2722/12 "2015-04-30T05:01:23Z")

</div>

can anyone here tell me how to use this or link me to a place that can. I’m in dire need of it currently as windows phone is the only device i can write apps for at the moment.

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [April 30, 2015, 6:44am UTC](https://community.particle.io/t/any-interest-in-a-net-client-for-spark-cloud-api/2722/13 "2015-04-30T06:44:44Z")

</div>

@MasterVizz & @developer_bt, the library comes with some test programs and nice `readme` that should get you started quite nicely.  
Once you have built and tried these test app, you might be able to ask some more focused questions.  
A general “help, I don’t understand” is a bit too foggy to help you in any useful way.

---

<div class="post-metadata">

**Author:** ![MasterVizz](https://avatars.discourse-cdn.com/v4/letter/m/c37758/32.png) [@MasterVizz](https://community.particle.io/u/MasterVizz)\
**Post date:** [April 30, 2015, 2:50pm UTC](https://community.particle.io/t/any-interest-in-a-net-client-for-spark-cloud-api/2722/14 "2015-04-30T14:50:50Z")

</div>

ok, let me rephrase my question, where do i need to copy the files to use them in the app I’m writing, I’m not that familiar with visual studio yet.

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [April 30, 2015, 5:47pm UTC](https://community.particle.io/t/any-interest-in-a-net-client-for-spark-cloud-api/2722/15 "2015-04-30T17:47:33Z")

</div>

I see 👀

Usually I’d put the whole project into the VS projects directory and build it once.

When you then write your own program you’d just add a reference to the built DLL and the appropriate `using` directive to use it in your own code.

---

<div class="post-metadata">

**Author:** ![MasterVizz](https://avatars.discourse-cdn.com/v4/letter/m/c37758/32.png) [@MasterVizz](https://community.particle.io/u/MasterVizz)\
**Post date:** [April 30, 2015, 6:04pm UTC](https://community.particle.io/t/any-interest-in-a-net-client-for-spark-cloud-api/2722/16 "2015-04-30T18:04:29Z")

</div>

well that makes sense, maybe one day i will good at this, thanks for the help. 😃

---

<div class="post-metadata">

**Author:** ![MasterVizz](https://avatars.discourse-cdn.com/v4/letter/m/c37758/32.png) [@MasterVizz](https://community.particle.io/u/MasterVizz)\
**Post date:** [April 30, 2015, 9:35pm UTC](https://community.particle.io/t/any-interest-in-a-net-client-for-spark-cloud-api/2722/17 "2015-04-30T21:35:41Z")

</div>

can you possibly post the difference between the version provided and the one you used? ive run into the same error and im not sure what to change.

---

<div class="post-metadata">

**Author:** ![kareem613](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/kareem613/32/1931_2.png) [@kareem613](https://community.particle.io/u/kareem613)\
**Post date:** [May 1, 2015, 2:42am UTC](https://community.particle.io/t/any-interest-in-a-net-client-for-spark-cloud-api/2722/18 "2015-05-01T02:42:01Z")

</div>

What’s the error your getting? Did you get as far is compiling? Running the tests?

@ScruffR Thanks for helping out!

@developer_bt @MasterVizz Check out [http://atomiot.com](http://atomiot.com). It might already do what you’re looking for. I built it using this .NET library.

---

<div class="post-metadata">

**Author:** ![MasterVizz](https://avatars.discourse-cdn.com/v4/letter/m/c37758/32.png) [@MasterVizz](https://community.particle.io/u/MasterVizz)\
**Post date:** [May 1, 2015, 5:38am UTC](https://community.particle.io/t/any-interest-in-a-net-client-for-spark-cloud-api/2722/19 "2015-05-01T05:38:37Z")

</div>

the error word for word is:

An exception of type’System.IO.FileNotFoundException’ occured in SharpSpark.dll but was not handled in user code

Additional information: Could not load file or assembly ‘System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’ or one of its dependencies. The system cannot find the file specified.

this error occured when trying to perform this line of code:

var result = CloudPost(functionKey, args);

it should be noted that i am trying to do this in a windows phone 8 app. the error is the same as the one mrabie had above, unfortunately he never explained fully what was needed to be done to fix it.
