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 →Category: C# Blogs
Resize a control within a WPF window grid at runtime
It’s kind of funny, you search and you search for the answer or keyword for achieving the resizing of controls within a WPF window at runtime but just can’t seem to get there easily. However, as soon as you find the right word there is an abundant supply of information about the topic. I mean […]
Read More →Resize WPF contents controls when window is resized
I created a nice utility in WPF today which contained a treeview, textbox, button and datagrid. The logic and work flow executed as expected, I was very proud of the work. I caught all my errors and exceptions and provided the user with options on how to proceed or correct the error. But the window […]
Read More →.NET Core 2.0 modular and NuGet packages
One of the cool features of the .NET Core is that the namespaces you reference in the project are the only ones that are contained in the DLL your project renders. I was reading that when you initially create a project in Visual Studio, that numerous packages are included by default and was wondering, because […]
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 →What is the current .NET version on an Azure App Service
I have an App Service here (currentdotnetversion) that shows the output of the current (when I wrote this article) .NET version using C# code. Here is a partial code snippet: protected void Page_Load(object sender, EventArgs e) { const string subkey = @”SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\”; using (RegistryKey ndpKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32).OpenSubKey(subkey)) { […]
Read More →CulturInfo not working as expected in C#
I have started working with Globalization and Localization functionality for a system I am building. I could not understand why, when I wanted to get the intellisense for the class that nothing showed up. After some time I decided to use the full name of the class to get to the methods like this: [sourcecode […]
Read More →Dynamic Type in C#, in comparison to var Type
Knowing the type of variable you are working with in C# and while programming in general is pretty important. You can’t add a double and an integer together and get an integer, without converting it. If you attempt to do this the compiler will throw an exception and you will not be able to run […]
Read More →Find a specific value within a generic list with a Lambda Expression using C#
With the release of C# 3.0 came Lambda Expressions. In a previous post I searched a generic list using a delegate, this is because, perhaps, I have done so much programming with C# 2.0 that it’s just a habit now. Time to move onto better, newer things, like Lambda Expressions. In the previous example I […]
Read More →Find a specific value within a generic list using C#
It is common to have a need to search though a generic list to know if it contains a specific value. This is where the Find() method can be used. There are many different scenarios you may encounter for searching, I will cover 2 here. The first is searching a list which contains a Class […]
Read More →