All posts by admin

How to Back Up and Restore IIS App Pool and Site Settings

Motivation:

You want to back up and restore IIS app pool and site settings.

Solution:

1. Open Command Prompt (Admin) and execute commands below to export IIS app pool and site settings to XML files.

%windir%\system32\inetsrv\appcmd list apppool /config /xml > \\192.168.101.140\BCDR\WEBBC02\E\inetpub\apppools.xml
%windir%\system32\inetsrv\appcmd list site /config /xml > \\192.168.101.140\BCDR\WEBBC02\E\inetpub\sites.xml

2. Remove all existing IIS app pools and sites, then execute the command below to import IIS app pool and site settings from XML files.

%windir%\system32\inetsrv\appcmd list apppool /config /xml < \\192.168.101.140\BCDR\WEBBC02\E\inetpub\apppools.xml
%windir%\system32\inetsrv\appcmd list site /config /xml < \\192.168.101.140\BCDR\WEBBC02\E\inetpub\sites.xml

Forget vs. Forget About

Forget is a general word, forget about is more specific.

  • I forgot my keys.“: Person forgot their keys, as in it was left somewhere, and the person doesn’t have it.
  • I want to forget about my keys.“: Person would like to “un”know about its keys, or wants to bury the memories of it.
  • I forgot that face.“: Person doesn’t remember how someone’s face looked like.
  • I forgot about that face.“: Non-direct way of saying one doesn’t remember all the facial features – but not the entire face.

How to Fix Firefox No Sound Issue

Problem:

Your Firefox suddenly does not play any sounds.

You have tried uninstalling and reinstalling it but the problem still persists.

Quick Solution:

  1. Go to Windows Settings > Sound > Advanced Sound Options .
  2. Make sure Firefox is not muted or set to low volume.

Advanced Solution:

  1. Create a Firefox account and synchronize (make a backup of) your current settings.
  2. Uninstall Firefox using Windows Apps and features.
  3. Go to %APPDATA%\Mozilla and delete Firefox folder.
  4. Open regedit.exe, search for Firefox, and delete all the keys and values that can be found. This process will take some time. Just ignore any errors that may occur when some keys or values cannot be deleted.
  5. Restart your computer.
  6. Download Firefox offline installer.
  7. Install Firefox.
  8. Log in your Firefox account and restore your settings.

 

 

How to Determine all Ports Opened by a Program in Windows

Motivation:

You want to ensure that your server is not compromised by a program.

Solution:

1. Open cmd.exe and execute commands below. Note the program file name and one of its ports that you want to investigate further.

netstat -a -b

2. Execute the command below. Note the PID associated with the port that you are interested in.

netstat -ano -p tcp

3. Execute commands below. “1544” is the PID that you are interested in.

netstat -ano -p tcp |find "1544"

4. Open https://mxtoolbox.com/TCPLookup.aspx, and enter [your external IP:port], and click TCP Lookup button to check if a port is open from your server.

5. Go to your Firewall and block the port if it should not be open to the Internet.

How to Change SQL Server sa User’s Password

Problem:

You are a Windows Administrator and you can log in SQL server instance. However you cannot access databases.
You want to log in the SQL server instance under sa user but you forget the sa user’s password.
You cannot the sa user’s password using SQL Server Management Studio.

Solution:

1. Open cmd.exe and execute commands below. Replace MSSQL$SQLEXPRESS with your SQL service name and localhost\SQLEXPRESS with your SQL instance.

net stop MSSQL$SQLEXPRESS
net start MSSQL$SQLEXPRESS /m"SQLCMD"
sqlcmd -S localhost\SQLEXPRESS

2. Type and press Enter for each line below.

ALTER LOGIN [sa] WITH DEFAULT_DATABASE=[master]
GO
USE [master]
GO
ALTER LOGIN [sa] WITH PASSWORD=N'Password@1234'
GO
exit

3. Open cmd.exe and execute commands below.

net stop MSSQL$SQLEXPRESS
net start MSSQL$SQLEXPRESS

4. Open SQL Server Management Studio and log in the SQL server using the sa account.

How to Fix Windows Updates Issue

Problem:

You were applying Windows updates to a Windows server and got an error with code 0x8007000d or 0x80073701. You tried restarting your server several times but it seemed that the problem still persisted.

0x80073701 = ERROR_SXS_ASSEMBLY_MISSING which means there are some system files are missing, which caused the update installation failure.

Solution:

1. Restart your server.

2. Open Command Prompt (Admin).

3. Execute the commands below.

net stop wuauserv
net stop bits
:: Removes all files from the directory
del /q C:\Windows\SoftwareDistribution\*
:: Recursively removes all nested directories
for /d %x in (C:\Windows\SoftwareDistribution\*) do @rd /s /q "%x"
net start bits
net start wuauserv
control update

4. Close the Command Prompt (Admin).

5. Install Windows updates.

6. Click Retry button if you encounter an error.

 

How to Select a .NET Framework

Motivation:

You need to select a .NET framework for your new project or for upgrading a legacy system.

However there are too many .NET framework branches so you are not sure which one is suitable with your need.

Guidelines:

You need to review the history of .NET framework and the differences among the various branches that include .NET Framework, ASP.NET Web Forms, ASP.NET MVC, .NET Core and .NET 6.

1. .NET Framework

The main purpose of .NET Framework is for building Windows Forms Applications.

  • .NET Framework 1.0 was released in 2002.
  • .NET Framework 2.0 was released in 2005.
  • .NET Framework 3.0 was released in 2006.
  • .NET Framework 3.5 was released in 2007.
  • .NET Framework 4.0 was released in 2010.
  • .NET Framework 4.5.2 was released in 2014.
  • .NET Framework 4.8.1 (the latest version) was released in 2022.
2. ASP.NET Web Forms

ASP.NET Web Forms was built on top of .NET Framework.

The main purpose of ASP.NET Web Forms is for building ASP.NET Web Forms Applications (multiple page web applications).

3. ASP.NET MVC

ASP.NET Web Forms does not follow MVC architecture pattern. Therefore MS built ASP.NET MVC.

ASP.NET MVC was built on top of .NET.

ASP.NET MVC is open-source software, apart from the ASP.NET Web Forms, which is proprietary.

The main purpose of ASP.NET MVC is for building ASP.NET MVC Applications (multiple page web applications based on MVC architecture pattern).

  • ASP.NET MVC 1.0 was released in 2009 (It was built on top of .NET Framework 3.5).
  • ASP.NET MVC 2.0 was released in 2010 (It was built on top of .NET Framework 4.0).
  • ASP.NET MVC 5 (the latest version) was released in 2022 (It was built on top of .NET Framework 4.8).
4. .NET Core

.NET Framework does not run on Linux or Unix and is proprietary. Therefore MS built .NET Core.

.NET Core runs on Windows, Linux and Unix, and is open-source software.

  • .NET Core 1.0 was released in 2016.
  • .NET Core 3.1 was released in 2019.
  • .NET Core then was renamed to just .NET in 2020 and .NET 5 was released in 2020. The .NET 4 name was not used to avoid name collision with .NET Framework.
  • .NET 8 (the latest LTS version) was released in 2023.

The main purpose of .NET Core or .NET is for building Windows Forms Applications, ASP.NET MVC Applications and Single Page Applications that run on Windows, Linux and Unix.

The ASP.NET Web Forms Application type was removed from .NET Core or .NET.

5. .NET 8

Currently (in 2024) MS supports 2 branches of .NET:

  • .NET Framework 4.8.1 (containing Windows Forms Applications, Web Forms Applications, and ASP.NET MVC Applications) and
  • .NET 8 (containing Windows Forms Applications, ASP.NET MVC Applications and Single Page Applications).

Both .NET Framework 4.8.1 and .NET 8 support building microservices.

6. ASP.NET
  • .NET is a developer platform made up of tools, programming languages, and libraries for building different types of applications.
  • ASP.NET is a .NET web framework. ASP.NET extends the .NET platform with tools and libraries specifically for building web apps. ASP.NET runs only on Windows.
  • ASP.NET Core is the cross-platform version of ASP.NET. ASP.NET Core runs on Windows, Linux, macOS, and Docker.
  • ASP.NET Core MVC is ASP.NET Core with UI components written in HTML, CSS, JavaScript and C#.
  • ASP.NET Core Razor Pages is ASP.NET Core with UI components written in HTML, CSS, JavaScript, Razor markup and C#.
  • ASP.NET Core Blazor is front-end web framework with code written in HTML, Razor markup and C#, and relies on a .NET runtime built with WebAssembly for client-server interactions.
7. Final thoughts

For a new system, you probably should use .NET 8 and ASP.NET Core.

For a legacy system, if you are using ASP.NET Web Forms then you may stick with .NET Framework 4.8.1. Otherwise you may upgrade your system to .NET 8 and ASP.NET Core.

 

 

Should We Rebuild or Renovate an Outdated System?

Motivation

You have an outdated system and want to rebuild or renovate it. You do not know which path is best for you.

Guidelines

Typically you have 2 main options for an outdated system.

Option 1 – Replacement: You can rebuild the whole system and migrate the existing data to the new system.

If you follow this approach then you may consider WordPress if your system is just a brochure website. WordPress is very suitable for building a brochure website.

If you system is a simple software supporting few business processes then you may consider EspoCRM. EspoCRM is very suitable for building simple business processes.

If your system is a sophisticated software supporting specific business then there may be several things you may need to consider when deciding to rebuild your system.

1. The effort to migrate the existing data to the new platform. A deep analysis of the existing data is required to create a reasonable estimate for this task.

2. The effort to integrate the new system with other systems that are integrated with the existing system. An analysis of the existing source code is required to create a reasonable estimate for this task.

3. The effort to implement all the existing business processes in the new system. A list of all business processes with their concrete steps is required to create a reasonable estimate for this task.

4. The possible mismatches of the new platform and the existing code base and data. These may require changes of business processes or removal of some existing features or considerable effort for migration.

5. Are the source code, database and files of the existing website fully available? Some websites might suffer vendor lock-in issue. It may be true that any exported data is unusable without the source code. Therefore no migration tool can help data migration due to specific data structures and constrains.

For example no one-way encrypted user passwords can be migrated to a new system. The best data that might be available for you is just Excel or CSV files. The contents of these files may be imported to the new system manually or automatically but no business logic can be transferred. In this case, rebuilding the whole system (preferably using WordPress) will require manually copying the contents to the new system and partially importing few tables (e.g. emails, first names, last names, page titles) to the new system.

Option 2 – Renovation: You may choose to renovate your system if the existing technology stack is not too outdated.

When choosing this option you may need to consider several things below.

1. The life cycle of the existing technology stack. The existing technology stack should not be deprecated and is still in active support.

2. The ecosystem of the existing technology stack. Most of 3rd party components for the existing technology stack should still be in development and support.

3. The capabilities of the existing technology stack. The existing technology stack should still support your new requirements although the solutions may not be perfect for performance or user experience.

4. The cost of the existing technology stack. You should still be able to afford the cost of the existing technology stack.

 

Should We Use SOAP or REST or gRPC or GraphQL for API Implementation?

Motivation

You want to implement an API for your client to integrate with your system.

You wonder if you should implement the API using SOAP or REST or GraphQL or gRPC.

Guidelines

Technically speaking SOAP is a protocol (developers must respect the protocol specification when working with it) while REST is an architecture style (Developers may not follow it strictly).

Most of software service providers (e.g. Salesforce, Sharepoint) provide both of them (SOAP and REST) for API clients.

The reason why a software service provider may implement both SOAP and REST is that legacy systems or frameworks (e.g. .NET, Java) often have many mature tools or libraries for consuming SOAP API easily while modern systems or frameworks (e.g. Node.js) often have many available tools/libraries for quickly consuming REST API.

If only one approach has to be chosen in order to reduce development cost then selecting SOAP or REST or GraphQL or gRPC for API implementation should depend on the API clients.

So the strategy below may help us select the most appropirate technology.

  1. Introducing your system capabilities to your client first.
  2. Then find out the main programming language that the client is using for their back-end services (e.g. Java, C#, PHP, JavaScript, Python, Ruby, Go)
  3. Find out the main API technology that the client is using for their back-end services or the API technology that they are most familiar with (e.g. SOAP, REST, GraphQL, gRPC).
  4. Then implement your API using the client’s API technology. The API can be implemented using a programing language that you are most familiar with.
  5. Then create the corresponding API developer guide and sample code for the client using their programming language.