.Net – ASPX – Error – “Invalid postback or callback argument. Event validation is enabled”

Background Tried using a dated .Net Application that I wrote quite a long time ago. I accessed a drop down, selected an item from the drop down, and clicked a push button. Errors Error - "Invalid postback or callback argument. Event validation is enabled using..." Unfortunately received an error that reads:- Text Invalid postback or … Continue reading .Net – ASPX – Error – “Invalid postback or callback argument. Event validation is enabled”

C#:- Compiler Error – “The entry point of the program is global code; ignoring ‘Main(string[])’ entry point”

Background Let us go with our old stand by. HelloWorld.   Language Language - C Script Code Output Output Image Using tio.run c / gcc compiler Output - Text   Language - C# C# - Without Class Definition Outline Let us convert our c code to C#. Code Changes Import c:- #include <stdio.h> Include stdio.h … Continue reading C#:- Compiler Error – “The entry point of the program is global code; ignoring ‘Main(string[])’ entry point”

Powershell:- Get Machine Name

Background I needed to confirm a machine name. It is easy to do so via accessing the machine and running a few system commands. But, want to do so programmatically, as well. Choices Here are some of the options for getting a machine name in PowerShell. Get Computer Name Using Environment Variables .Net Class System.Environment … Continue reading Powershell:- Get Machine Name

Programming Languages:- Repeat Characters

Background When programming one will have to use various datatypes and consult API for each of the data types.   DataTypes Number/Integer Arithmetic String Concatenation Length Character Repeat   Character For instance, if we will like to place an underline against a title, we will get the length of the title, and repeat the underline … Continue reading Programming Languages:- Repeat Characters

.Net Error:- “COM object that has been separated from its underlying RCW cannot be used”

Background Last night after a long day of code rewrite, ran into an error that threatened to force me to discard the numerous optimizations I had taken the time and effort to labor over.   Error Message Here is the full error message:- Remediation Outline Code Review Code Rewrite Code Review Please review your code. … Continue reading .Net Error:- “COM object that has been separated from its underlying RCW cannot be used”

.NetSDK – Build – Error – NETSDK1045 – “The current .NET SDK does not support targeting .NET Core 3.1. Either target .NET Core 3.0 or l ower, or use a version of the .NET SDK that supports .NET Core 3.1.”

Background A day or two short of a week ago, a family member ran into issues building a Microsoft  .Net application that he had downloaded from GitHub. Error Error Message - NETSDK1045 TroubleShooting Outline Project File Review Project File Project File ( .csproj ) Review Project File ( .csproj ) Text <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFrameworks>net452;netcoreapp3.1</TargetFrameworks> … Continue reading .NetSDK – Build – Error – NETSDK1045 – “The current .NET SDK does not support targeting .NET Core 3.1. Either target .NET Core 3.0 or l ower, or use a version of the .NET SDK that supports .NET Core 3.1.”

.Net – Reflection

Background When programming tracking the current class/method can be helpful. Also, capturing the Stack Trace can also be informative.   C# Current Class Current Method StackTrace Output   Vb.Net Current Class Current Method StackTrace Output   Source Code .Net Fiddle C# Link Vb.Net Link Summary This post ended up being a lot of fun. Comparing … Continue reading .Net – Reflection

.Net :- String.Join returns “System.String[]”

Background Hit a curb yesterday and wanted to share about it today. I have a collection and attempted to display its contents.   Code Original Output Image   Revision Output Image Sharing Restester.com Links Visual Basic Online Compiler Link Vb.Net - Displaying Collection Contents Link Git Gist CollectionDisplayContents Link Dedicate Dedicating to:- string.Join(string, string[]) returns … Continue reading .Net :- String.Join returns “System.String[]”

.Net – String Collection – Dumping list’s contents

Background A few days ago I needed to examine the contents of a string collection. I was surprised that the contents of the collection were not dumped. What was dumped instead is the collections' class name. Examination Outline Let us give a couple of use cases:- Array of String System.Collections.Generic.List<string> System.Collections.Specialized.StringCollection System.Collections.Specialized.StringCollection Convert   Array … Continue reading .Net – String Collection – Dumping list’s contents

VB.Net – Compilation Warning – “Variable is used before it has been assigned a value. A Null Reference could result at runtime”

Variables Looking at an aged code and I started rearranging it a bit. Unfortunately, re-arranged, it stopped working. I took a night's sleep. Come the next day, less tired and wearied, I went back at it. Thankfully, I had made a backup and had it tucked away. Looking at the saved code, I found out … Continue reading VB.Net – Compilation Warning – “Variable is used before it has been assigned a value. A Null Reference could result at runtime”