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…

 

A new look for .NET Reference Source

Just saw this… (totally cool) J http://referencesource.microsoft.com/ Channel nine video: http://channel9.msdn.com/Series/NET-Framework/How-to-browse-the-NET-Reference-Source Further details on our blog: http://blogs.msdn.com/b/dotnet/archive/2014/02/24/a-new-look-for-net-reference-source.aspx
Continue reading…

 

Error when application run from a network share: That assembly does not allow partially trusted callers!

Recently had a customer who faced this issue when his application is run from a network share. The exception information is as follows … ************** Exception Text ************** System.Configuration.ConfigurationErrorsException: An error occurred creating the configuration section handler for dataConfiguration: That assembly does not allow partially trusted callers. (G:SystemBackofficeCitrix2008MediaExplorerRev2008ProdMfm.MediaExplorer.exe.Config line 28) —> System.Security.SecurityException: That assembly does […]
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…

 

Interesting read: Microsoft Intermediate Language (MSIL) instructions

Taken from MSDN: http://msdn.microsoft.com/en-us/library/system.reflection.emit.opcodes_fields(v=vs.120).aspx  AddAdds two values and pushes the result onto the evaluation stack. Add_OvfAdds two integers, performs an overflow check, and pushes the result onto the evaluation stack. Add_Ovf_UnAdds two unsigned integer values, performs an overflow check, and pushes the result onto the evaluation stack. AndComputes the bitwise AND of two values and […]
Continue reading…

 

[.net] gcAllowVeryLargeObjects Element–beat the 2GB array size limit on 64 bit

Please note that this post is only applicable for .net 4.5 and above. Having trouble with .net array size limit, i.e. 2GB on a 64 bit target. Use above tag in your config file to work around this issue. A sample config file will look as follows… <configuration> <runtime> <gcallowverylargeobjects enabled=”true” /> </runtime> </configuration></pre> Please […]
Continue reading…

 

Convert a VB6 project to VB.net Visual Studio 2010

Are you having trouble converting VB6 project to VB.net Visual Studio 2010. Well just to be frank you should have long back converted this VB6 project of yours to VB.net. VB6 is ancient and just because your code works doesn’t mean that you won’t migrate it to a newer platform. In my opinion let your […]
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…