Just a dump blog post for short development tips.


Microsoft Windows 8

Always run pinned programs on the taskbar as administrator
If you want the programs pinned on the windows taskbar to always be [Run as Administrator], the open the folder containing the windows taskbar pinned shortcuts:

  • %APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar
  • Right click pinned shortcut > Properties > Advanced…
  • Check [Run as administrator’]image
How to Disable Caps Lock Key in Windows



Microsoft SQL Server 2012

Run a *.sql script
"C:\Program Files\Microsoft SQL Server\110\Tools\Binn\sqlcmd.exe" -S (localdb)\V11.0 -d MyDatabase -E -b -i "C:\Temp\script.sql"
Attach an existing database to a Local Db instance

Open the a command prompt with Administrator rights, then enter:
sqlcmd -S (localdb)\V11.0
use master

create database Cris on
(filename= N’C:\Databases\MyDatabase1.mdf’)
for attach;



Microsoft Visual Studio 2012

How to copy unit test output from the Test Explorer
You might think, you can’t copy the output of the unit test from the Test Explorer, because you can’t select the text, but if you click on the window and just press CTRL + C.
And in your code windows press CTRL – V, all output of the test is pasted in the code window.


Output pasted in the code window:

How to Assert code has thrown an exception in a MSTEST unit test

If you want to Assert if some code has thrown a specific exception with a specific message, you can wrap the code in a try – catch block, but you can also use XUnit assert in MSTEST, combining MSTEST en XUnit. 

using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Assert = Xunit.Assert;

namespace Research.Rli.Tests
    public class ResearchTester
        public void Test()
            string message = "The system detected an error.";
            Exception ex = Assert.Throws(typeof(ApplicationException),
                () => { throw new ApplicationException(message); });
            Assert.Equal(message, ex.Message);
How to show all pending changes for all users in TFS


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Posts