Posts

Moving ASP.NET Session State Server to Aurora/MySQL

Our database was in MS SQL Server and we were in the middle of moving to Aurora with MySQL compatibility. And obviously there are differences to be resolved and one of them is we are not sure on how to move the ASP.NET Session state. After several troubleshooting sessions (pun not intended), I finally managed to move the session state server to Aurora. The following two webpages have been very helpful, albeit the first one is outdated: https://www.codeproject.com/Articles/633199/Using-MySQL-Session-State-Provider-for-ASP-NET https://dev.mysql.com/doc/connector-net/en/connector-net-programming-asp-provider.html My steps are as follow: 1. Disable the current state server by commenting/removing the sessionState tag under system.web in web.config. 2. Add MySql.Web Nuget package (As of this post, the working one is version 8.0.17). 3. Add new sessionState tag under system.web <sessionState mode="Custom" customProvider="MySqlSessionStateStore">  ...

Install Previous Version of Nuget Package that is not Visible

Sometimes a new software version also introduces a new bug and we need to rollback. And this time is on one of the Nuget package that we use. When troubleshooting MySql Nuget package issue, I noticed that I can't revert back to the previous version using the version drop down under Nuget manager window in Visual Studio.  So, a bit of searching reminds me that I can use the Package Manager Console to install a package. Maybe I can specify the version and the server still has it. So I uninstall the latest package and ran the following command: Install-Package < package_name > -Version < version > -Source nuget.org The source option is optional. In my case, somehow I had it defaulted to some other source so I have to actually specify it in the command. Hit enter and I got the previous version installed. Problem solved!

Convert FAT32 to NTFS with No Data Loss in Windows

Filesystem is as usual a pretty complicated thing. And I happened to have a new external hard drive that for somewhat reason was formatted as FAT32. Of course, I didn't notice until I put a bunch of data in it.  The time has come when I need to store file larger than the 4GB limit of FAT32.  So browsing around the internet, I found out that I can convert to NTFS without data loss and third party software from  https://www.tenforums.com/tutorials/85893-convert-fat32-ntfs-without-data-loss-windows.html . The steps that I took are: Make sure data are backed up somewhere else. Close all software/application that has the drive opened. I closed the File Explore too. Run command prompt as administrator. Run the following command in command prompt: convert <drive> /fs:ntfs . For example: convert D: /fs:ntfs Restart the computer. That's it!

Kernel not Updated on Ubuntu 14.04 in AWS EC2 Nitro-based Instance

Sometimes a simple thing which works for many others doesn't work for us and this time it is on updating the Linux kernel. It is all started when we are trying to migrate an m1 to t3. We are aware that t3 is a Nitro-based instance thus NVMe and ENA module have to be installed. Even after following AWS documentation, the modules don't seem to be installed properly even after reboot. Then the journey begins.  First, I ran the following command to check what kernel is actually loaded: uname -r In this particular case, it returns:  3.13.0-45-generic.  And I know that it is not the latest. So, as suggested by Amazon support, I ran the following commands one by one to see if the latest linux-aws package are properly installed and at the latest and nvme driver is loaded into the kernel ( NVME driver is set to 'Y')   sudo apt-cache policy linux-aws ls -al /boot/ cat /boot/config-4.4.0-1044-aws |grep -i "nvme" And the result are all as expected. The late...

ASP.NET Web Forms, Auth0 and OWIN

Sometimes supporting an old technology is much more troublesome, but when you manage to overcome the challenge, you will be feeling so much more satisfied. My boss wants to use Auth0 for authentication, but the application that we need to modify is in ASP.NET Web Forms and there is no Auth0 quickstart for ASP.NET Web Forms and I can't find an example online. I remember I saw somewhere that we can use OWIN on ASP.NET Web Forms with a bit of tweaking. Following the awesome blog post below, I managed to get OWIN to work. https://tomasherceg.com/blog/post/modernizing-asp-net-web-forms-applications-part-2 Next, I followed Auth0 quickstart for ASP.NET (OWIN) https://auth0.com/docs/quickstart/webapp/aspnet-owin/01-login#configure-auth0 One thing to note, the RedirectUri specified in the app has to be registered in Callback URLs in the Auth0 account. Then comes the customization. First, I need to be able to secure pages. Reading online, I found out that simply adding the f...

Amazon Aurora Serverless "The provider did not return a ProviderManifestToken string" Error

We had a good working application which connect to Amazon Aurora Serverless pretty well and just recently it started to intermittently unable to connect with the error "The provider did not return a ProviderManifestToken string". The following is some spec of the application: .NET Framework 4.6.2 MySQL.Data 6.10.9 MySQL.Data.Entity 6.10.9 EntityFramework 6.2.0 (EF6) When I debugged the application, it has inner exception which has the message: "Sequence contains more than one matching element". Upon more troubleshooting, I remember that Aurora Serverless is a cluster and it requires at least 2 subnets which reside in 2 different Available Zones. Amazon does not recommend the use of IP address instead provide us with an endpoint to connect to the cluster. That means, the endpoint might resolve to two IP addresses. So, I decided to see what DNS lookup will show and indeed, the endpoint resolves to two IP addresses. Hence, my suspect is the MySQLConnection w...

OpenVPN Client Save Connection (IP Address)

When I first used OpenVPN client, it was set up for me so I'm missing out on some configuration know how. And now I need to set up OpenVPN on a new computer and I need to save a connection so I can quickly connect to it the next time I log on. In this case, I'm using a v2.x.x OpenVPN client and I can't seem to figure out how to do that. It turns out that I have to be disconnected from all connections and then select Import > From server.... Then I can enter my connection information and it will be saved and easily accessible just by hovering over it and select Connect...