Tags: .NET

How to install .NET 5

Benjamin Perkins C#

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#

Benjamin Perkins 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 →

String vs. StringBuilder

Benjamin Perkins C#

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 →

Configuration error, targetFramework 4.7

Benjamin Perkins C#

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

Benjamin Perkins C#

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 →