What is a .winmd and how to use it in a desktop application

A .winmd is a file used by Windows 8 WinRT (Windows Run Time).  winmd stands for Windows Meta Data file which is the same format used by the .NET framework for the CLI (common language interface).  As such it can be viewed by .NET tools such as Reflector and the ildasm tool packaged with .NET.  You can find these files in various places but one command place is c:\Windows\System32\WinMetadata.

These files are focused on Windows store apps but it doesn’t preclude you from using them in a traditional desktop app.  To do so you need to do the following to your desktop application in order to leverage functionality in these APIs.

1.  Unload your application.  Edit the project file and add the tag near target version, “<TargetPlatformVersion>8.0</TargetPlatformVersion>”.

2.  Reload your project.  You will need to add a reference to the following DLLs.

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\WindowsBase.dll

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Runtime.dll

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Runtime.WindowsRuntime.dll

3.  Now you will be able to leverage functionality provided by the WinRT framework, such as camera, NFC, etc.

Setting Up TFS Team Build To Use TFS Build Extensions

The other day I was reminded of how great TFS Build Extensions really are.  I’ve used them in the past and currently use them and still have not tapped there fullest resources but find they are always there to do 99% of what I need done.  If you are using TFS and team build, these are a must.  In this post I’m going to do a quick run through on setting up build extension on your build machine as well as your local development environment.  A more detail version of what I summarize below is found in the TFS Build Extensions Documentation.

1.  Download the TFS Build Extensions from http://tfsbuildextensions.codeplex.com/.  Unzip content into C:\Tools\.

2.  Follow the directions in TFS Build Extensions Documentation to check in these build extension into the {team project}\BuildProcessTemplates\Custom Assemblies.  This will be used by the build controller/build agent as well as you when you are working on the build workflow and need toolbox items.

Below is an example of a team project with the Custom Assemblies folder under BuildProcessTemplates and a ProcessTemplates.sln which has 1 project to house our build definitions.

image

3.  After following the setup steps TFS Build Extensions Documentation you will be able to create a workspace to your build templates folder, get latest, and open the build template project the documentation had you create.  The key to being able to work on the template on your development machine is to include the TFS extension in your toolbox.  Following the documentation will have you setup for this so your development will look like the following.  In the toolbox I added the items from the library TfsBuildExtensions.Activities.dll, which should be in your {team project}\BuildProcessTemplates\Custom Assemblies\ folder.

image

Using WPF and Vector Graphics

Recently I’ve been taking a look at WPF, Microsoft’s not so new now replacement for WinForms.  With the little free time that I have, I’ve relied heavily on Pluralsight for getting up to speed on various technologies.  In working with WPF, I was trying to leverage their concept of “lookless” controls which is very powerful and much nicer to design with than WinForms. 

To summarize my tribulations, I was having a hard time loading a local resource that was a SVG.  Blend Expression, a WPF designer, doesn’t support SVG directly but it does support .pdf (a form of SVG) and .ai (Adobe Illustration).  There are a couple of ways to product .pdf or .ai files.  My approach was to use a tool I’ve used in the past, Inkscape, see Inkscape A Cool Tool.  Inkscape also support generating a XAML file directly from the SVG file which you can leverage directory or copy the contents of XAML output into a resource dictionary.

1.  Open or create your SVG file in Inkscape.

2.  PDF format: Select Save As and choose .pdf format.  It will display a dialog as below once you click Save, ensure you select “Convert texts to paths”, then click OK.  Once the file is saved you can rename the file extension from .pdf to .ai.  It will now be recognized in Expression Blend.

image

 

3.  XAML format:  Select Save As and choose .xaml format.  This will export it directly to a XAML file.  You can take the content line, element is a ViewBox, and put that directory in a resource file.

Outlook 2013 Always Prompts for Credentials using Active Directory

You ever have those technical issues that aren’t quit annoying enough to deal with in your normal day of busyness?  I really have enjoyed where Microsoft have taken Office in the last few years, but after installing Office 2013 Professional, which has Outlook 2013, I kept receiving a login prompt for my Active Directory credentials every time I open Outlook.  For a while, I thought it was something to do with our IT’s exchange server, but did a little googling to figure it out. 

It turns out that if you have Exchange connected through HTTP, it will always prompt, even if you ask it to remember you credentials, or even tell it not to prompt!  How annoying.  Below is the image of the setting you need to uncheck to fix this pest of an issue.

image

You can get to this screen by going to: Account Settings, double click the mail account in question, click the More Settings… button, then click the Connection tab.