Generate HTML file from XML using XSLT

Recently I had to work on FxCop, for static code analysis. For those who don’t know what is FxCop, check this link. But one issue I faced was, the report can be saved / exported from FxCop is only in XML format. I searched for tool which help me to...


"Remove and Sort" namespaces using shortcut in Visual Studio

If you are using StyleCop for maintaining C# coding standards and conventions, we used to do Remove and Sort namespaces feature from Visual Studio. The Organize Usings options in the Visual Studio integrated development environment (IDE) provide an easy way to sort and remove using and extern declarations without changing...


Create Custom Configuration Sections in .Net

This post is about creating custom configuration sections in .Net. If you search for this topic in internet, you will find lot of code snippets and blog posts(Here is the MSDN link). Unlike that, this post is about a nice tool, .NET Configuration Code Generator which will help you to...


Read Excel as DataTable using OpenXML and C#

In the current project we were using OpenXML extensively for reading Excel files. Here is the code snippet, which will help you to read / convert Excel files to DataTable. using System; using System.Data; using System.Linq; using DocumentFormat.OpenXml.Packaging; using DocumentFormat.OpenXml.Spreadsheet; public static DataTable ReadAsDataTable(string fileName) { DataTable dataTable = new...


How to pass parameters to Work Flow

You can create arguments to workflow and can pass the values from outside. For creating arguments, you can use the Arguments Tab in the WorkFlow designer. In the last post I mentioned about loading and invoking a WorkFlow, the WorkFlowInvoker class’s Invoke method has an overload, which accepts inputs parameter,...


How to load WF workflows dynamically

This is post is about loading and running Workflow foundation (WF) XAML files. It is a powerful technique which can be used to change Workflows on the fly, without re-compiling the application. All this functionalities can be achieved via single line of code. WorkflowInvoker.Invoke(ActivityXamlServices.Load("Activity1.xaml")); Happy Programming :)


Share on facebook - chrome extension

Long back I wrote a post about how to create a chrome extension. This post is about creating an extension which will help you to share current page URL on facebook. You can follow the same steps in the previous post except few changes in the background.js file. And facebook...