On some installations of Visual Studio 2010, 2012 or 2013 I’m confronted with strange behavior. One of these strange things are the black lines in the Watch Window of Visual Studio. Just like the screenshot below (this isn’t my screenshot, I’ve ‘borrowed’ it from someone else)

Normally this has something to do with the graphics driver, but updating these drivers doesn’t work all the times. There’s also a work around for this problem, described on the MSDN forum.
The work around is:
Go to Tools > Options > Environment > Font and Colors
Search for the settings for [Watch, Locals, and Autos Tool Windows]
For Text select the Default for Item ForegroundThe options will look something like the image below.

After you’ve set this option you’ll be able to see the text in your watch window again. The lines will be white again with black text.
Read more →There comes a time when you have to do something which appears impossible at start. One of the things I had to confront is moving my SQL database files from the D-drive to the L-drive.
Moving regular SQL database files isn’t that hard at all. Just detach the database, move the files to a new location and attach the database again. However, system databases can’t be moved in this way, which makes sense if you think about it. To move the system databases, you need to run some queries. This method is described on MSDN and there are also some forum posts which describe the necessary actions.
For future reference, I’ll describe the necessary steps below.
First, stop the SQL Server and add the following to the startup parameters:
-dL:\Databases\MSSQL.1\MSSQL\Data\System\master.mdf;-eL:\Logs\ERRORLOG;-lL:\Databases\MSSQL.1\MSSQL\Data\System\mastlog.ldf
This will make sure the master database files are searched at the new location (L:\Databases\MSSQL.1\MSSQL\Data\System\)
Now move the physical master database files to the new location.
At this moment it’s possible to start SQL Server again by running the following command:
NET START MSSQLSERVER /f /T3608
This will start SQL Server in master-only mode. You can open Management Studio now again and start a new query window (the Object Explorer doesn’t work in this mode) (using SQLCmd wil also work). In this new query window you will have to execute this script to move the databases to the L:\Databases\MSSQL.1\MSSQL\Data\System\ location.
Read more →Windows 8 has given us a lot of new and cool features for both developers and users. One of these features is the possibility to pin websites to your start screen. Default this tile will look like the favicon of the website, but you are also able to change the pinned tile to a live tile. The live tile will get the necessary information from the RSS feed of the website.
To enable this website-live-tile-feature, just follow these steps.
First, navigate to the https://www.buildmypinnedsite.com website which acts as a wizard. This website is able to create both the icons and necessary HTML you need to implement on the website.
Just specify the title of the website, the background color of your tile and upload an image you want to use for your live tile. The result will be something like the image below.

As you can see, there are 4 tile sizes you need to configure. The preview of the tiles is available at the right side of the screen.

The wizard doesn’t do a very good job at creating images. Therefore I’ve created my own tiles using Paint.NET with the correct dimensions. The dimensions you need to use for a tile are specified in the table below.
Read more →For some time now I’ve been in possession of the Sony PRS-T1 e-reader. E-readers are great devices and I find it much easier to read from an e-ink screen compared to a regular tablet screen.
However, there’s one thing which is really annoying specific to this Sony PRS-T1. It’s the home screen. Lucky for me the hardware runs on a modified Android OS, so there have been a lot of people modifying the looks and feels of the device. There’s a nice read of hacks and tweaks which can be found on this page.
One of the tweaks which can be found over there is changing the behavior of the ‘Recently Added’ pane on the home screen. If you read a couple of books at the same time, it’s better to see the ‘Recently Viewed’ books on the home screen. That way it’s possible to quickly navigate to the books you are reading.
To change this behavior you need to access one of the databases on the device and create a new trigger in it.
The databases on the device are (similar?)https://Lite](https://www.sqlite.org/) databases, therefore you can connect to them using the SQLite Administrator. After having installed this tool you can just open the books database on the device:
Read more →Some time ago Microsoft has introduced the ASP.NET Web API framework. It’s a framework you can use to create your own RESTful services. It’s much like WCF Data Services or WCF RIA Services, but a lot easier to use (IMO). I’ve never liked the WCF-stack much, probably because configuring it always posed to be a hassle.
Using the Web API framework is much easier and you have to configure a lot less, or at least I haven’t found all of the configurable options yet. Then again, it’s created for entirely different purposes of course.
To create a service you select the ASP.NET MVC4 project template and can create new controllers which inherit from the ApiController. It’s also possible to do some awesome queries on your client nowadays, because Web API is capable of supporting OData! Install the latest stable NuGet package and you are ready to go!
Because I was put on a new project, I was finally able to do some real work with ASP.NET Web API. We had to develop a solution containing a so called self-hosted Web API service which also supported OData queries. This sounds like a lot of work, but it’s actually rather easy to do so nowadays.
During this new project we had some time to investigate and learn a bit about the platform. Therefore we chose to use the latest version of everything we could find, just to keep us up-to-date. To get OData working we used the beta2 version which works great for the simple stuff we were doing.
Read more →The solutions in the project I’m working on are quite big and can easily take up 30 to 90 seconds to build, even though we have rather fast laptops. This is probably because of some build-plugins we are forced to use and the tight SharePoint integration of those plugins. Nevertheless, it’s quite annoying to see Visual Studio ‘hang’ every time you build your solution.
Last week I had some time on my hands to do some research on how we could improve these long builds. Turns out you can call MSBuild directly and let your solution compile outside of the Visual Studio instance. The build will still take up about the same amount of time, but it’s less annoying as you can still do some work in Visual Studio.
I’ve used Scott Hanselman’s blogpost to create some new External Tools in Visual Studio, placed them in my Menu and created keyboard shortcuts for them.
At the moment I’ve got 3 new items in my menu to build my complete solution, clean my complete solution and to build the project I’m currently working in.

The ‘Clean Solution’ button bound to the default out-of-the-box functionality, offered by Visual Studio.
The External Tool ‘Solution (MSBuild)’ is configured like so:
Read more →When setting up an Orchard website you’re given a choice to use a ’normal’ SQL database, or SQL Compact. When developing new modules I often choose for the SQL Compact option. I choose this option, because it’s very easy to backup and restore the database file. If you mess something up, you’re fairly safe.
You can of course backup and restore normal SQL databases, but this takes a bit more effort compared to copy-pasting a database file.
I hardly ever use a SQL Compact database in other environments as development. This means whenever I need a dump from the Testing environment to Development I’ll get a normal database backup file, or a bacpac export file. These files can only be restored to normal SQL databases, so that’s a small problem.
Apparently no one at the SQL-team has considered that someone might actually want to ‘downgrade’ their database to SQL Compact.
When searching the web you’ll find a lot of pages people asking the question “How can a SQL database be migrated to SQL Compact”. As it happens, migrating to SQL Compact is rather easy, once you’ve found the appropriate posts on Stack Overflow. @ErikEJ has written 2 applications which make it really easy to do such a migration.
Read more →All of a sudden all my websites didn’t work anymore. Using some common sense in searching for the root of the problem I discovered the IIS Admin Service hadn’t started after booting up my machine. Trying to manually start up the service didn’t help much either, I was confronted with a message telling me
The system cannot find the file specified.
Sadly, the event logs didn’t help much, as the logs told me about the same
The IIS Admin service terminated with the following error. The system cannot find the file specified_
Having not much to go from here I had to start searching the web to check if other people had stumbled across this issue also. Lucky for me, someone had indeed solved this problem, back in 2008 and blogged about it. Muqeet had discovered this error usually occurs when the metabase.xml file is missing or corrupt.
Checking out the default location of the metabase.xml file (C:\WINDOWS\system32\inetsrv\) confirmed this. Somehow the file was gone from the file system. Lucky for me IIS is backing up the file when a change is made within the IIS configuration. The backups can be found in the History folder (C:\WINDOWS\system32\inetsrv\History\).
Restoring the most recent backup to the original location had fixed the problem. The IIS Admin Service was able to start again, which means all the websites in IIS had started also.
Read more →Some time ago my ForeFront TMG server had crashed and not being an expert sysadmin, I wasn’t able to figure out what was wrong. The only thing I could think of was restoring the server from an earlier snapshot. Thanks to the Hyper-V interface this is really easy, even a software developer can do this.
After having restored the server to an earlier state I connected to the server and was prompted with a message telling me “the trust relationship between this workstation and the primary domain failed”. I figured this had probably something to do with restoring the snapshot from quite a while back. Doing some research on the issue confirmed my suspicions.
Apparently this happens when your machine can’t communicate securely with the Active Directory anymore. This can happen for a number of reasons. Reason for my machine not being able to communicate anymore has probably something to do with some password changes, which the old snapshot wasn’t aware off.
Microsoft has an article dedicated to this issue. They tell you to remove the machine from the domain and rejoin. This seems a bit rigorous and I don’t really want to do such things to my ForeFront server. Without it I don’t have internet!
Read more →At the moment I’m working on a (Orchard) project which is deployed to Windows Azure and uses a SQL Azure database. As my team needed to fix some issues which occurred in the Acceptance and Production environment, I wanted to get a recent database dump so we would be able to reproduce the issues on the development machines.
I couldn’t find an easy way to synchronize the databases or create a backup which I could restore. After doing some extensive searching I discovered there is a way you can restore a SQL Azure database to a local SQL Server 2012 environment.
To do this, you have to create an export in the Azure Management portal and import this export into your SQL Server 2012. I’ll describe the necessary steps below.
First, head to the Azure Management portal and go to the Database tab. On this screen you’ll see the option Export the database at the bottom of the screen.

Clicking on this button pops up a modal dialog. In this dialog you need to specify the name of the export, a bacpac file, which storage account you’ll use, container to save the file and the login credentials of the database.
Read more →