Routing not working when using areas in MVC.

November 5, 2017 at 5:29 PMMadestro

I recently came across a situation where I had two controllers named Home. One existed under an area and the other one under the normal Controllers folder.

The routes started misbehaving and sometimes they would fail.

I found a few articles about adding namespaces but that didn't seem to work.

After hours of searching and thinking, I figured it out. The namespaces have to match the location of the Controllers folder. Here is a sample to illustrate:

                new { controller = "System", action = "Index", id = UrlParameter.Optional}
                , new[] { "MyWebApp.Admin.Controllers" }


Notice the namespace includes the the Controllers folder.

It's not just any name. It has to match your Controllers namespace exactly.

Posted in: ASP.NET MVC

Tags: ,

How to find out who is logged in to a network computer with PowerShell

July 9, 2017 at 4:10 PMMadestro

Here is how to figure out who is currently logged in to a network computer. This comes in handy for situations where you need to access the computer, say, via Remote Desktop connection and someone is already logged in:

 Get-WmiObject -Class win32_process -ComputerName PUT_COMPUTER_NAME_HERE | Where-Object{ $_.Name -eq "explorer.exe" } | ForEach-Object{ ($_.GetOwner()).Domain + "\\" + ($_.GetOwner()).User; }

Type that all in one line.

Posted in: Windows Networking


How to Find Document Roots in nginx

April 29, 2017 at 9:39 PMMadestro

You can find document roots using grep. Search in the /etc/nginx/sites-enabled directory to limit the focus to active sites. The -R flag ensures that grep will print both the line with the root directive and the filename in the output:

grep "root" -R /etc/nginx/sites-enabled

The result will look like this, although the names and number of results will vary based on the installation:


/etc/nginx/sites-enabled/default:       root /var/www/html;

/etc/nginx/sites-enabled/default:       # deny access to .htaccess files, if Apache's document root

/etc/nginx/sites-enabled/default:#      root /var/www/;

Posted in: Ubuntu

Tags: ,

How to fix Visual Studio Could not evaluate Expression

October 11, 2016 at 1:16 PMMadestro

Sometimes you will come across a situation where you debug in Visual Studio and you are unable to look at the variables. You simply get a message that reads:

"Could not evaluate Expression"

Long story short, one of the reasons this happens is corrupt breakpoints.

Pull up your Breakpoint window and erase every single breakpoint you have. Compile and set your breakpoints again.

Problem solved. :-)

Posted in: ASP.NET MVC | General Development | Visual Studio


Configuring BlogEngine.NET with GoDaddy

September 6, 2016 at 1:04 AMMadestro

If you are reading this, chances are you have figured out by now that GoDaddy does not allow external mail relay.

In other words, if you try to use an external mail server to send e-mail, it won't work.

Fortunately, the solution is simple:

Use their mail relay.

If you are like me, however, you are probably confused as the GoDaddy relay server uses network delivery which means it does not use a username and password.

To get this to work, use the following settings:

  • E-mail Address:
  • SMTP server:
  • Port Number: 25
  • Username: [BLANK]
  • Password: [BLANK]

([Blank] = Do not enter anything, leave empty)

Good luck!

Posted in: Everything else | General Development | Web Development


Toggling Orphan Rows in BeyondCompare 4

June 23, 2016 at 9:51 AMMadestro

Recently, I was comparing two CSV files. I wasn't interested in orphan rows (rows that existed in one file but not the other). I only wanted to see what had changed in records that existed in both.

I found a few articles but they were all outdated. I eventually figured it out so I thought I would share it with you:

  1. Right click on the toolbar on top (bar with icons like Next Diff)
  2. Select Toggles

You should now see additional buttons on the toolbar that allow you to show/hide orphan rows on either side, among a few other things.

So apparently the bar that loads by default is the "Favorites" one. Counter-intuitive if you ask me.

Awesome product, nevertheless.

Posted in: Everything else | General Development


Outlook says I have an unread message, but all messages are marked as read!

October 8, 2015 at 9:54 AMMadestro

I have rules configured in Outlook that move e-mails to different folders. One of these folders was reporting an unread message but the folder content view showed all messages marked as read.

It turns out there is a very simple way to fix this. There is in fact an e-mail that is not marked as read. You can find it by accessing the web version of the product, which is commonly available in company deployments. The URL is usually:, or, or

Once you find it, mark it as read on the web interface and Outlook will automatically refresh and no longer show unread messages.

Posted in: Windows Networking


Cannot login in AspDotNetStoreFront 9.5, continually redirects back to login page

August 9, 2015 at 3:42 PMMadestro

I came across a situation where I could not login to AspDotNetStoreFront. It kept redirecting me back to the login page with no apparent error message, which seemed to indicate that the login was successful, yet it wasn't doing anything.

The issue turned out to be the time zone difference between web server and database server. I was running my copy locally and the time at the server was running a few hours behind, which causes the application to think you have "timed out".

To work around this, there is an application setting named "SessionTimeoutInMinutes" that you can change to a value greater than the time zone difference, in order to keep the session active.

I had trouble locating this setting. Eventually I figured out it used to live in a configuration file apparently, but it now has been moved to table "AppConfig" in the database. Change the "ConfigValue" column value and it should allow you to log in. 

Make sure to restart the application afterwards to force reloading of the settings.


Posted in: AspDotNetStoreFront


Running Windows Authentication with IIS Express

August 6, 2015 at 10:18 AMMadestro

You may run into a situation where you have configured your site to run Windows authentication but you get an authentication error when you try to browse it during a debug session.

To fix this issue, you need to edit the Application Host file for IIS and enable Windows authentication. You can find the file here:

\My Documents\IISExpress\config\applicationhost.config

Find the <security> section inside the <system.webServer> node and enable Windows authentication as follows:

      <windowsAuthentication enabled="true" />

And that's all there is to it. :-)

Posted in: ASP.NET MVC | Visual Studio | Web Development


How to inspect Angular scope for an HTML element

May 18, 2015 at 11:41 AMMadestro

It turns out there is a very simple way to inspect the Angular scope for a particular HTML element if you are using Chrome.

Simply right click on an element on the page, select inspect element, switch to the console tab and type the following:


Alternatively, you can select an element from the HTML tab and then go to the console and type the script command.

Posted in: Angular