Weekend Reading List

What I Learned From Bombing An Amazon Coding Assessment

Are you going to interview at tech companies? Make sure you read Andrew’s tips on how to solve coding questions. His approach is really valuable.

Easy data seeding in .NET (Core) applications

Almost all developers have that annonying moment where you have to create dummy data locally in order to test your application. This article uses `DbTool` utility and `Korzh.DbUtils` library for seeding the database.

Debug & Catch Exceptions in Visual Studio: The Complete Guide

Am I the only always putting a break point in `catch` line _after_ I have encountered the exception? I’m sure I’m not. Well, there’s a setting option in Visual Studio to break on every exception, so you can avoid this very issue.

7 Habits Of Highly Effective Programmers – Inspired by an ex-Google TechLead #humor

It’s not just enought to be a good programmer, it’s also help to become a highly effective programmer. Avoid meeting is one of the habits.

The Steve Wozniak Guide to Building Better Software

Pretty easy read on how to apply hardware-engineer approach to become better software developer in software-engineer.

Good Reads This Week

DevOps Before and After Kubernetes

This is a fun read, a lil bit of educational, but more of informative IMO. Anoop explains how Kubernetes has changed DevOps: automation. And with idempotency and immutability, we can increase efficiency and economics benefits in DevOps-ing Kubernetes.


Exploring the Visual Studio Test Platform

34-minute video that goes back to basic: unit testing, why we need it and how to do it. But this one goes even deeper, how to do it in Visual Studio, Visual Studio Code and Azure Pipelines, executing tests in parallel, migrating, diagnostics crashes and much more! Worth your 34 minutes.


Think Like A Startup When Launching Your Analytics Program

Build your analytics program with startup mindset. Yes, it may not be a technical read, more of philosophical, but still a good read regardless.


Come discuss your side projects! [July 2019]

I thought this thread is pretty cool, people come together to discuss their own side projects. Get some creative ideas going and some of the projects are actually really cool! This thread is for July 2019, but there is a new thread every month.


ASP.NET Core 3.0 Exception Handling

Have you ever used `try/catch` blocks but still miss some errors? Dino explains a more effective way to trap exceptions that go unnoticed and unhandled in ASP.NET Core 3.0


Go team proposes parametric polymorphism

Generics is coming to Go language! Parametric Polymorphism, a fancy way to say Generics, however, is still in a draft. But, let’s hope it’s going to be released soon.

Shared Assembly in Visual Studio Projects

Here is steps to create shared assembly file in multiple VS projects:
1. Add new shared assembly file.
2019-06-10 16_38_40-LinqJoin - Microsoft Visual Studio (Administrator)

2. For each project that will use the shared assembly, right click on the `Properties` under the project and add existing item.
2019-06-10 16_43_15-

3. Select the shared assembly file, but add it as a link
2019-06-10 16_39_38-LinqJoin - Microsoft Visual Studio (Administrator)
2019-06-10 16_40_12-LinqJoin - Microsoft Visual Studio (Administrator)

4. Remove attribute in the project assembly that you want to inherit from the shared. For example, if you want to share `AssemblyVersion` across projects, remove them from projects’ assembly and add it shared assembly file.


using System.Reflection;

[assembly: AssemblyVersion("")]
[assembly: AssemblyFileVersion("")]

“The CodeDom provider type Microsoft.VisualC.CppCodeProvider could not be found” exception

This problem happened when you build project/solution in Visual Studio. Generally caused when you have compile-able files in your Visual Studio solutions but VS could not understand it.
In my case, I have infamous ‘node_modules’ folder.

To solve this issue, in Windows Explorer, I right click on it ‘node_modules’ folder and select ‘Properties’, check ‘Hidden’ under Attributes.

You can also exclude the folder. In Visual Studio Solution Explorer, right click on ‘node_modules’ and select ‘Exclude From Project’.

More reading.

Resource Files In ASP.Net MVC

Scott Allen has a great post explaining how resource files work in ASP.Net MVC project using Visual Studio. Technically speaking, this also applies to ASP.Net Web Form.

Basically, there are these problems:

  • Placing resource files in App_GlobalResources folder will break unit tests.
  • Intellisense has trouble recognizing syntax in the Views.
  • App_LocalResources seems to have similar behavior.

The solution is ostensibly simple. Just put resource files in a separate folder, name it anything you want. This will:

  • Embed the resource files in library when the project is compiled.
  • The generated class is internal by default. This is can be changed if you need to share the class publicly.

To change generated class to public, change ‘Custom Tool’ property of the resource file to ‘PublicResXFileCodeGenerator’ instead of ‘ResXCodeFileGenerator’.

Visual Studio 2012: Debugging Unit Tests Doesn’t Work

There’s a problem in Visual Studio 2012 where debugging unit tests doesn’t work. This often happens when you enable code coverage.

The solution is fairly simple, un-check any selected test setting file under Test > Test Settings.

This behavior is expected, at least according to Microsoft, they just don’t support debugging for code coverage.

Peek Your Definition in Visual Studio 2013

My friend, Scott G, told me about this. There is a new feature in Visual Studio 2013 called Peek Definition. Peek Definition allows you to see your class definition in the same file window. It even lets you edit and save the file!

You can access Peek Definition by right click on class that you want to peek and click Peek Definition. Or simply use shortcut key ALT + F12.



To exit from the Peek Definition, press ESC on your keyboard. You can also switch between the class definition window and your current file window by pressing SHIFT + ESC on your keyboard.

I found this very convenient feature when writing unit testing code, I can easily and quickly switch between two files.

Shortcut summary:

ALT + F12
Show Peek Definition.

Exit from Peek window.

Switch between Peek and current file windows.

Visual Studio Template Parameters

When creating a single Visual Studio template (or multiple), the following parameters are available:

Parameter Description
clrversion Current version of the common language runtime (CLR).
GUID [1-10] A GUID used to replace the project GUID in a project file. You can specify up to 10 unique GUIDs (for example, guid1).
itemname The name provided by the user in the Add New Item dialog box.
machinename The current computer name (for example, Computer01).
projectname The name provided by the user in the New Project dialog box.
registeredorganization The registry key value from HKLM\Software\Microsoft\Windows NT\CurrentVersion\RegisteredOrganization.
rootnamespace The root namespace of the current project. This parameter is used to replace the namespace only in an item being added to a project.
safeitemname The name provided by the user in the Add New Item dialog box, with all unsafe characters and spaces removed.
safeprojectname The name provided by the user in the New Project dialog box, with all unsafe characters and spaces removed.
time The current time in the format DD/MM/YYYY 00:00:00.
userdomain The current user domain.
username The current user name.
webnamespace The name of the current Web site. This parameter is used in the Web form template to guarantee unique class names. If the Web site is at the root directory of the Web server, this template parameter resolves to the root directory of the Web Server.
year The current year in the format YYYY.

Source: MSDN

Visual Studio Multiple Projects Template

To create a Visual Studio project template that include multiple projects, create a new .vstemplate file:

<VSTemplate Version="2.0.0" Type="ProjectGroup"
        <Name>Acme Web Project</Name>
        <Description>A project template to create Acme Web.</Description>
            <ProjectTemplateLink ProjectName="Acme.Web">
            <ProjectTemplateLink ProjectName="Acme.Common">

Place the file in a folder containing all project template folders. In this case, “Acme.Web” and “Acme.Common” templates.

Source: MSDN

NuGet Packages in Visual Studio Project Template as New Project

When include NuGet packages in Visual Studio project template, a modification will need to be done if the template will be used as new project.

Modify .vstemplate file:

        <packages repository="template">

Notice repository attribute in <packages> node.

All the .nupkg files must be placed in the root directory of project template zip file.