VS2013 .net application fails to run on Windows XP

Do you run into following error when trying to run a VS2013 .net application on Windows XP? Error: Not a valid Win32 application! This happens because the application is targeting .net framework 4.5 which is not supported on Windows XP. Target a lower framework to get your application working on XP.
Continue reading…

 

System.DateTime Custom Formatters

Problem Recently a customer opened a ticket thinking that there is an issue with the DateTime formatting function. They had the following piece of code. namespace DateTimeDefect{    class Test    {            static void Main(string[] args)            {                DateTime dt = DateTime.Now;                 Console.WriteLine(dt.ToString(“f”));                Console.WriteLine(dt.ToString(“ff”));                Console.WriteLine(dt.ToString(“fff”));                 Console.ReadLine();            }    }} Except for dt.ToString(“f”) the other two were returning […]
Continue reading…

 

Using Visual Basic PowerPack DataRepeater control in Visual Studio 2013

DataRepeater is great control to display data from a table/view, as the name says repeats bunch of fields from a dataset on every row. Follow these simple steps to get started working with this control… Step 1: Add a reference to the PowerPack library as shown here: http://ntcoder.com/bab/2013/12/20/visualbasic-powerpack-missing-from-visual-studio-2013/ Step 2: Make sure you’ve got the […]
Continue reading…

 

[Interop] Call into .net/managed code from native/unmanaged code

Introduction I’ve got a native console application which would like to call into a piece of managed code written in C#. This is the how the C# function “Sum” looks like… My solution explorer looks as follows… CSharpModule is a CSharp library while TestManagedCall is a native/unmanaged project. My requirement is as follows: call Class1.Sum […]
Continue reading…

 

[.net] Setting up Fusion Logging to figure out Assembly bind failures

What is fusion Fusion is the module in .net which manages binding of .net assemblies. So the question here is why do we need to setup fusion logs. Since we know that fusion is module which is responsible for assembly bindings, its good to know that it also emits verbose logs known as fusion logs. […]
Continue reading…

 

Difference between a class and struct in .net

Thought I will share some interesting differences between a .net class and a struct. Class Struct Allocated on the heap. Allocated on the stack. They are value types and don’t require heap allocation. A variable of a class type stores a reference to a dynamically allocated object. A variable of a struct type directly stores […]
Continue reading…

 

.loadby sos clr fails! Why?

You have a managed application crash dump and you would like to load sos.dll, to use the powerful commands it provides to help with managed debugging, but the load of sos.dll always fails. The command that you are executing for loading sos.dll is… 0:015> .loadby sos clr Unable to find module ‘clr’ On enter you […]
Continue reading…

 

WMI in .Net

It’s quite easy to work with WMI in .net. Follow these steps to get details of Win32_VideoController. Namespace to use is System.Management. 1. Create a management class object. [sourcecode language=’cpp’]Dim MngClass As New ManagementClass(“Win32_VideoController”)[/sourcecode] 2. Create a management object class collection instance and fill out this collection likewise… [sourcecode language=’vb’]Dim MngObjCollection As ManagementObjectCollection = MngClass.GetInstances […]
Continue reading…