Archive for Uncategorized

26 Sep 2012

Using Source Code Pro Font With Visual Studio

7 Comments Uncategorized

You may or may not be aware but Adobe released a new font a couple of days ago. Who cares right, you are not a graphics designer, you sling code for a living. Well you should care about this font. Adobe has released a font that has been optimized for coding. And I am here to tell you it is a beautiful font.

I have been a huge fan on Consolas ever since it was released by Microsoft. And I was excited to see a new alternative font from Adobe. And to make it even more interesting, Source Code Pro is open source font on GitHub and they are accepting pull requests for it. In other words, it can only get better from here.

Given that I am always looking for the perfect coding environment, I decided to install Source Code Pro, and set it up in Visual Studio. To get started you need to do the following:

  1. Download the latest release from their GitHub page.
  2. Extract the fonts to a folder.
  3. Navigate to the folder that contains the Source Code Pro fonts.
  4. Select the fonts. (I selected all the ones with .ttf to install)
  5. Right-click the selected fonts and choose “Install.”
  6. The fonts are now installed and will appear in the font menus of your applications.
  7. Open Visual Studio.
  8. Go to Tools > Options > Fonts and Colors.
  9. Change the Font to Source Code Pro in the drop down.
  10. Restart Visual Studio.
  11. Now you are ready to start using Source Code Pro.

Here are examples of Consolas (on the top) side-by-side with Source Code Pro (on the bottom).


You can click on each image and open them up in new tabs in your browser, and switch back and forth to see the subtle changes between the two. It should also be noted that Consolas is running at 10 pt and Source Code Pro is running at 9 pt, which seem to produce the same size characters on my machine.

I am actually really digging the Source Code Pro font, and I am looking forward to updates when they are released. And if you know anything about creating fonts, please help out and contribute. Personally I enjoy looking through the source on GitHub and learning about how fonts are constructed.

17 Sep 2012

Could not load file or assembly ‘Microsoft.Data.Services, Version=5.0.0.0″

No Comments Uncategorized

Recently while working on an OData endpoint for a web service I am setting up I came across this error. I did a quick search on the web, but all that I came up with was a bunch of overly complicated solutions to fix this issue. So I thought I would write up a quick blog post and put an end to the insanity of this error and all the snake oil that seems to be on the web about it.

This error comes up because there is a reference in your application, either through a framework config or library reference that references the 5.0.0.0 version of the Microsoft.Data.Services assembly. This usually happens because you have included in a more recent version, usually via NuGet, and for whatever reason NuGet decided not to add the following to your config file. Either way here is all that you need to do.

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>
            <assemblyIdentity name="Microsoft.Data.Services" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="1.0.0.0-5.0.0.0" newVersion="5.0.2.0" />
        </dependentAssembly>
    </assemblyBinding>
</runtime>

The newVersion attribute in the bindingRedirect element needs to be set to whatever the latest version of the Microsoft.Data.Services you are running from NuGet.

Please note that this will not work in Silverlight or Windows Phone, so if you are developing in either of those frameworks please try some of the snake oil. Also please then turn to Microsoft and point them to the strong naming SemVer approach that the ASP.NET team is using to prevent issues like this from occurring. By only updating the version number on major releases of the library.

07 Aug 2012

Chief Tecumseh Poem

No Comments Uncategorized

Last night I watched Act of Valor it was decent movie, but it wasn’t a great movie, some of the dialog seemed forced. But one part of the move really stuck out to me. At the end a poem by Native American Shawnee Chief, Tecumseh was read.

I thought it was a great poem, and definitely words to live your life by.

So live your life that the fear of death can never enter your heart. Trouble no one about their religion;respect others in their view, and demand that they respect yours. Love your life, perfect your life, beautify all things in your life. Seek to make your life long and its purpose in the service of your people. Prepare a noble death song for the day when you go over the great divide.

Always give a word or a sign of salute when meeting or passing a friend, even a stranger, when in a lonely place. Show respect to all people and grovel to none.

When you arise in the morning give thanks for the food and for the joy of living. If you see no reason for giving thanks, the fault lies only in yourself. Abuse no one and no thing, for abuse turns the wise ones to fools and robs the spirit of its vision.

When it comes your time to die, be not like those whose hearts are filled with the fear of death, so that when their time comes they weep and pray for a little more time to live their lives over again in a different way. Sing your death song and die like a hero going home.