Category Archives: C#

Visual Studio 2015 error “Object reference not set to an instance of an object”

This fixed my razor intellisense problem and the error after installing the latest ASP.NET tools. Here is how to fix it. Delete the contents from the following folders: C:\Users{user}\AppData\Local\Microsoft\VisualStudio C:\Users{user}\AppData\Local\Microsoft\VSCommon Navigate to the command line now and run devenv from either of these paths: [x64] C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE [x86] C:\Program Files\Microsoft Visual… Read More »

Where is Inspect.exe for UI Access?

Stupid SDK doesn’t give any details on where the SDK path is, etc. Well, Install the Windows 8.1 SDK with the options. You have plenty of disk space, so don’t whine. Here is the path for the 64 bit version. C:\Program Files (x86)\Windows Kits\8.1\bin\x64   Happy Coding!

Force rebind on a WPF control or view by resetting the DataContext without using null!

I had an issue where I wanted to force a datacontext to rebind everything. The RaisePropertyChanged(“”) wasn’t working and I like to keep things simple. I was setting the DataContext = null then setting it back to the desired object right after to force a rebind. This worked well but really pissed off some of… Read More »

FIX: TabControl in WPF Shows wrong tab if Active Tab is Invisible

You want to dynamically show or hide tabs in WPF. Say, some only show up if a certain option is set. Well, it shows anyway if its the first tab. Stupid. Here is an attached property to fix that. Based on code from   using System; using System.Collections.Specialized; using System.Windows; using System.Windows.Controls; namespace Seekford… Read More »

How to run a batch file with administrator priveleges with automatic elevation

Do you have build scripts that require you run commands elevated. Do you forget to click run as admin then you get errors halfway through a 20 minute build? Well, I did all the damn time. I found this script change and it works awesome so I figured I would share with the class. if… Read More »