MVC 5 Showing Errors

ASP.NET MVC 5 offers an easy way to display error.

Step 1: Setup the error View

You create an error view “Error.cshtml”

   1: @model System.Web.Mvc.HandleErrorInfo

   2: @{

   3:     ViewBag.Title = "Error";

   4: }

   5: <h1 class="text-danger">Error.</h1>

   6: <h2 class="text-danger">An error occurred while processing your request.</h2>

   7: <h2 class="text-danger">Details: </h2>

   8: <h3 >@Model.Exception.Message</h3>

   9: @Html.ActionLink("Back", @Model.ActionName, @Model.ControllerName)


Step 2: Return the Error View in your Controller Action

   1: try

   2: {

   3:  ...

   4: }


   6: catch(Exception ex)

   7: {

   8:     return View("Error",new HandleErrorInfo(ex,"MyController","MyAction"));

   9: }




Bay Area – Peninsula Cities and Rent Control


Peninsula Cities with Rent Control

  Measure Start Date Result
San Francisco  
East Palo Alto Measure J Nov 2016 Yes: 79%
No: 21%
Mountain View Measure V 12/23/2016 Yes: 53%
No: 47%
San Jose  

Peninsula Cities Rejected Rent Control

  Last Measure Date Result
Burlingame Measure R Nov 2016 Yes:33%
No: 67%
San Mateo Measure Q Nov 2016 No: 61%


East Bay Cities with Rent Control

  Last Measure Date Result
Alameda Measure A1 & L1 —
eviction protection,
rent control
Nov 2016 A1
No: 28%

Yes: 56%
No: 44%

Berkeley Measure AA Nov 2016 Yes: 72%
No: 28%
Oakland Measure JJ – expand eviction protection to almost all apartments Nov 2016 Yes: 74%
No: 26%
Richmond Measure L Nov 2016 Yes: 64%
No: 36%

How to Configure Outlook 2016 to use Free Google App Email with 2-Step Verification (2 Form Authentication)

If you enable 2-Step Verification on your free/legacy Google app account, you need to:

  1. Generate an app password via Google Account Security.
  2. Use that generated app password instead of your normal password when you configure Outlook.

Note that you can use either POP or IMAP as long as you enable them in your Google account.


Windows 10: No Internet Access after Windows Fall Creators Update


  • I am running Windows 10 with Hyper-V enabled
  • My Hyper-V has a virtual switch: an external adapter connecting to my wireless network adapter.
  • Windows Update just installed version 1709, i.e. Fall Creators Update on 11/19/2017.


  1. My host PC’s wireless connection now has NO internet connectivity.
  2. One of my virtual machines no longer shows up in Hyper-V Manager.


To regain internet access right away, the following works for me:

  1. Launch Hyper-V Manager
  2. under Actions, select Virtual Switch Manager
  3. Verify that there is a Default Switch, installed by Windows Update – Fall Creators Update.
  4. Select the virtual switch that connects to the wireless network adapter. 
  5. Remove it.
  6. image
  7. My host PC got back Internet access.  The wireless network adapter was no longer “bridged” using the external virtual adapter.

At this point, I can use Default Switch as the virtual switch for all my guest virtual machines under NAT.

If I want to use the old setup, I just recreate a virtual switch with an external network that connects to the host PC’s wireless network adapter.

For the missing virtual machine, I had to recreate the virtual machine (i.e. configuration):

  1. Launch Hyper-V Manager
  2. Actions –> New –> Virtual Machine
  3. Connect to my existing Virtual Hard Disk


The loss of internet connectivity and a virtual machine is scary after a Windows Update.  I hope this post helps.

How to Auto Download Windows Update for Windows Server 2016


I like to configure my servers to download windows update automatically ahead of time.

When I can choose to manually install them later, I can install them right away without waiting for the download.


To do this in Windows Server 2016 is not straight forward, I haven’t found a way to do it using the desktop UI.


I have to do it via command line.

  1. Run a command line prompt as an admin.
  2. Type “sconfig”
  3. Type “5” to select “Windows Update Settings”
  4. Type “D” to select DownloadOnly



Ring Central–Forwarding Calls

RingCentral has this feature that can forward an incoming extension call to your cell phone.  However, it does not work for me.  My cell phone never rings and the caller goes into Ring Central voice mail.


  1. Go to the user setting
  2. Choose “Call Handling & Forwarding
  3. Choose “Incoming Call Information
  4. Under “Play announcement …”, select “Never
  5. Save





How to Troubleshoot Audit Failure Event 4625

If you get hundreds of these 4625 events, it is probably because your server has remote desktop enabled and your server is facing the internet.  For example, your server may be on the AWS or Azure with RDP port 3389 allowed for any public source IPs. 


Cloud Network Firewall Fix:

Assuming you keep remote desktop service running, then you should configure AWS / Azure Security Group’s inbound rules to allow only your IP to connect to port 3389.  All these events should stop occurring.   In summary, you are blocking all IP addresses except yours.

Windows Server Firewall Fix:

As usual, please backup your servers.  If you block your own IP from accessing server’s remote desktop port using Windows Server firewall, you need to do a restore.

What if you cannot just do block all and except? or maybe you want to find out the specific IP that is causing that event?

If you examine the event, you will see that there is no network info: workstation name, source network address, source port.  I will show to how to find out the source network address.

In fact, there is little useful info.  We know Logon Type: 3 means a “network logon”.

We know Account Name: “ADMIN1” does not exist on our server and so it is a guessed account name.  The Sub Status: 0xc0000064 confirms that.

If you see Account Name: “Administrator” and the Sub Status: 0xc000006a means the hacker guess the wrong password.

You need to write a key info and that is the event date time (in Event Xml), down to the sub seconds level.

You download and run Process Monitor (not Process Explorer).  You run it and let it start capturing data.  When you see a new event 4625, you can stop the capture and start looking through the big log.  You locate the log entries closest to the event date time.  You may see errors such as LOGON FAILURE or NAME NOT FOUND.  Go backward in time, you may come across some logs regarding remote desktop connection.  Note “ms-wbt-server” is port 3389, used by RDP.


It tells you the source IP of the machine trying to connect and logon.  That is the source IP you can add to Windows Firewall and block.

Again, DO NOT BLOCK your own IP.  Otherwise, you cannot remote desktop to the server any more.

An account failed to log on.

    Security ID:        NULL SID
    Account Name:        –
    Account Domain:        –
    Logon ID:        0x0

Logon Type:            3

Account For Which Logon Failed:
    Security ID:        NULL SID
    Account Name:        ADMIN1
    Account Domain:       

Failure Information:
    Failure Reason:        Unknown user name or bad password.
    Status:            0xc000006d
    Sub Status:        0xc0000064

Process Information:
    Caller Process ID:    0x0
    Caller Process Name:    –

Network Information:
    Workstation Name:   
    Source Network Address:    –
    Source Port:        –

Detailed Authentication Information:
    Logon Process:        NtLmSsp
    Authentication Package:    NTLM
    Transited Services:    –
    Package Name (NTLM only):    –
    Key Length:        0