Alright this time I have again made my life a bit easy by finding a solution for problem where I want to test a library but I do not want to create .Net Solution using VS and then type class and all those. Since I want to just test the working of an API so I do not want to go soo long. Someone will say then use IronRuby and do it; but then we do not get Syntax Highlighting, Code completion, intellisense and etc. (productivity enhancing tools).
So I get this nice tool called CSHELL; its a REPL for C# script (isn’t that cool).
So let me show you how I have experimented this tool by solving one of my simple issue.
As you all know we in Platform team working on DB renewal stuff and we often need to check various different Databases and their functionality. This time I wanted to check Couchbase’s functionality on How to get the list of buckets in a default pool. Terminologies may be confusing for some who does not understand about Couchbase but in simple term Bucket is a collection of JSON documents.
1) Run cshell -> Download it from here. It is just an .exe so you can just run it. (Tips: Better to pin it up with the Taskbar for easy access);
2) You will see this main window.
3) Now I want to have the reference to Couchbase .Net SDK.
4) Select the required ones
5) Now I have written the statement in the script to check the problem which I described earlier. So here is the snapshot of it:
You see I get the intellisense. isn’t that nice? And if you see a bit above that I was using a class without the reference (that too two time ) and it gives me a colourful error . That’s neat.
Intellisense with LINQ as well. Nice!!
And finally I get the result which I want.
That’s it. It took me just 5 mins to do this. Time creating this blog post is not counted
More info you can find in http://cshell.net/.
Please share if you find something useful as well or something which does not work. Its a good way to use C# as a scripting language.