ClickOnce and WinForms application – tiny tips

The below are few points that we learned during a recent application developed using WinForms and deployed using ClickOnce.

Refracting to use native PC/SC interface

The core functionality of the application was to provide proximity card based attendance system for students in a classroom. For this we were previously using the API provided by HID Global. This caused various dependency issues between Windows operating systems and architectures (32bit vs 64bit), so as part of the refactoring we have removed the dependency and using the PC/SC interface exposed by Windows natively. Of course, this means mucking around a bit in the P/Invoke world (for accessing WinScard.dll related functions), but it provides elegance to the application by eradicating extra baggage of dependency.

Authenticating with the help of System.DirectoryServices.AccountManagement

With the help of System.DirectoryServices.AccountManagement (available from .NET Framework 4.0) authenticating users against Microsoft Active Directory has become a lot simpler. Compare the below code 1 2 3 4 5 public static bool IsAuthenticated( string domain, string username, string pwd ) { using ( PrincipalContext pc = new PrincipalContext( ContextType.Domain, domain) ) { return pc.ValidateCredentials( username, pwd ); } } to what you have to do previously

Secret Universe – The Hidden Life of the Cell

Came down with fever, and this reminded me of this documentary … go defense go!

Zen Coding for Visual Studio 2012

Don’t wait, head over to VS extensions gallery and grab hold of Web Essentials 2012 by Mads Kristensen. The extension offers good amount of features for VS based developers, of all of them the one I am going to talk about is the Zen Coding style introduced by Sergey Chikuyonok (as mentioned in

Before I proceed further Zen Coding style has been implemented across various text editors, and if you are a full time or regular web developer you should have a look into it. For all the supported text editors check out the Wikipedia entry at

Once you have installed Web Essentials 2012, you will have support for coding in Zen Coding style development inside of Visual Studio 2012. The main idea behind the coding style is to reduce the manual typing process of creating the mundane html code for your web application. It is kind of text expansion mechanism, but it is much more than that.

Displaying SYS_REFCURSOR / CURSOR results from Oracle in Toad

I keep forgetting this method when I try to debug a procedure after some interval, so I am blogging it for my own reference.


      i_user_domain   IN     IEMS_USERS.DOMAIN%TYPE,
      i_user_login    IN     IEMS_USERS.LOGIN%TYPE,
      o_roles            OUT SYS_REFCURSOR);

Generally, we can right click on the procedure name on the schema browser and select Execute package, which gives the skeleton for executing your procedure. Once we have the code, we just add a refcursor variable at the top, assign its value from the output of the procedure and then print it at the end.

Oracle Managed ODP.NET

Note:This documentation/guide is based on Managed ODP.NET v11. Beta

Download Managed ODP.NET from Oracle Technology Network.

Finally Oracle has released a pure .NET based client for connecting and working with Oracle databases from your CLR world without the dependencies lying around in the GC ignorant world. With a reference added to the Oracle.ManagedDataAccess.dll which weighs a mere 6+ MB’s (against 150+ MB’s previously) you are ready to get started with you day-to-day interaction to the 10g R2 or higher Oracle Databases.

WebAPI – Multiple actions were found that match the request

WebAPI looks very suitable for exposing RESTful services for any web based application. So, during a recent implementation of WebAPI on a project I was receiving the Multiple actions were found that match the request exception. To get some context below was my setup: The route configuration: 1 2 3 4 5 6 7 8 9 public static class WebApiConfig { public static void Register( HttpConfiguration config ) { config.