Things change and as I always say “that’s better than the alternative”. Although I have yet to put my finger on it, the behavior I experience when debugging Core applications is different than those which have come before. If I ever do figure out the specifics of those differences, I will write them down and […]
Read More →Tags: .NET
How to install .NET 5
This release is a big deal. Basically, all the different versions of .NET like shown in the following bullet list are merged into this one version called .NET 5. .NET Framework .NET Core .NET Standard From .NET 5 all projects can be run cross platform and cross verticals like WPF and ASP.NET. Here are some […]
Read More →How to use Data Parallelism from the Task Parallel Library in C#
I wrote a program a few months back that populated a dropdown list with contents from a class using reflection. I used a normal for each statement. [sourcecode language=”csharp” padlinenumbers=”true” autolinks=”false” gutter=”false” toolbar=”false”] foreach (Type type in assembly.GetTypes() .OrderBy(f => f.MetadataToken)) { if (type.Namespace != null) { if (!type.Namespace.ToLower().StartsWith(“namespace”)) combobox1.Add(new ComboBoxClass(type.Name, type.FullName)); } } [/sourcecode] […]
Read More →How to create a Pie chart using ASP.Net and C#
Since .Net 4.0, we no longer need to download and install the Chart Control to get charting capabilities in ASP.Net, Window Forms or WPF. This is becuase the the Charting control is now part of .Net 4.0 itself. Although all you need to know about Charting in ASP.Net can be found here I thought I […]
Read More →How to read from and write to an app.Config or web.Config using C#
There are a number of ways you can do this. In this example I will use the ConfigurationManager libraries that are part of the .Net Framework. This group of methods and properties are created specifically for this purpose. I am a firm believer that every action we want to take as a programmer needs to […]
Read More →String vs. StringBuilder
A blog would not be complete without an article about the differences between appending or modifying a string using the String Class versus the StingBuilder class. See, strings are immutable, which means once they are created they cannot be changed. Any time you make a modification to a string, after is has been created you […]
Read More →Fields vs. Properties in C#
There is a very significant difference between a field and property within a class. The difference is in the behaviour of the field when defined as either a static or instance. Basically, if you create 2 instances of class which has a static field, when you change the value of that field, the values in […]
Read More →How to stop selection change event in combo-box from firing when populating loading it
If you have ever wanted to take some action when a user changes a selection in a combo-box (drop down selection list) you would put your code in the SelectionChanged event of the WinForm or WPF system. If you have ever wanted to set the combo-box to a default value when the window is being […]
Read More →Configuration error, targetFramework 4.7
I was deploying some code to one of my IIS servers and got this YSOD as seen in Figure 1. I had coded in Visual Studio 2017 with the .NET Framework 4.7 targeted from my ASP.NET Web Forms application I wrote. Figure 1, Server Error, targetFramework=”4.7” Server Error in “/” Application. Configuration Error Description: An […]
Read More →Targeting a specific version of the .NET Framework
I find numerous opinions and understandings about side-by-side and in-place installations of the .NET Framework. Here is my favorite explanation of this “.NET Versioning and Multi-Targeting – .NET 4.5 is an in-place upgrade to .NET 4.0”. I also link to that same article in one of my IIS labs here, “Lab 5: Basic and Advanced […]
Read More →