Welcome to EMC Consulting Blogs Sign in | Join | Help

Merrick Chaffer's Blog

  • Visual Studio 2008 Command Prompt here

    To create this, just download the inf file for 2005 from Scott Hansleman’s blog post here…
    http://www.hanselman.com/blog/VisualStudioCommandPromptHereAndSearchUnknownFileExtensions.aspx
     
    and then alter it in notepad for all references to 2005 to 2008, and the path to the vsvars32.bat.

    Then any folder that you select you’ll see a shortcut to open a visual studio command prompt at that location.

    The same should work for 2010 as well by the way!

    (Alternatively just create a Vs2008CommandPrompt.inf plain text file, and cut and paste the following text into it).

    ;
    ; "CMD Prompt Here" PowerToy
    ;
    ; Copyright 1996 Microsoft Corporation
    ;
    ; Modified to launch VS.NET 2008 command prompt 5/6/03 MG
    
    [version]
    signature="$CHICAGO$"
    
    [VSNet2008CmdHereInstall]
    CopyFiles = VSNet2008CmdHere.Files.Inf
    AddReg    = VSNet2008CmdHere.Reg
    
    [DefaultInstall]
    CopyFiles = VSNet2008CmdHere.Files.Inf
    AddReg    = VSNet2008CmdHere.Reg
    
    [DefaultUnInstall]
    DelFiles  = VSNet2008CmdHere.Files.Inf
    DelReg    = VSNet2008CmdHere.Reg
    
    [SourceDisksNames]
    55="VS .NET 2008 CMD Prompt Here","",1
    
    [SourceDisksFiles]
    VSNet2008CmdHere.INF=55
    
    [DestinationDirs]
    VSNet2008CmdHere.Files.Inf = 17
    
    [VSNet2008CmdHere.Files.Inf]
    VSNet2008CmdHere.INF
    
    [VSNet2008CmdHere.Reg]
    HKLM,%UDHERE%,DisplayName,,"%VSNet2008CmdHereName%"
    HKLM,%UDHERE%,UninstallString,,"rundll32.exe syssetup.dll,SetupInfObjectInstallAction DefaultUninstall 132 %17%\VSNet2008CmdHere.inf"
    HKCR,Directory\Shell\VSNet2008CmdHere,,,"%VSNet2008CmdHereAccel%"
    HKCR,Directory\Shell\VSNet2008CmdHere\command,,,"%11%\cmd.exe /k cd ""%1"" && ""C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat"""
    HKCR,Drive\Shell\VSNet2008CmdHere,,,"%VSNet2008CmdHereAccel%"
    HKCR,Drive\Shell\VSNet2008CmdHere\command,,,"%11%\cmd.exe /k cd ""%1"""
    
    [Strings]
    VSNet2008CmdHereName="VS.NET 2008 Command Prompt Here PowerToy"
    VSNet2008CmdHereAccel="VS.NET &2008 CMD Prompt Here"
    UDHERE="Software\Microsoft\Windows\CurrentVersion\Uninstall\VSNet2008CmdHere"
  • How to use the Resharper Stack Trace Explorer

    Copy a stack trace to your clipboard, open the resharper stack trace explorer, and hit Ctrl+E, T. Once you’ve done this the lines reported in the stack trace become hyperlinks to the files in your project.

    image

  • How to host WCF services in IIS 7.5 on Windows 7

    If you see this error when hosting a WCF service under IIS 7.5 on Windows 7,

    HTTP Error 404.17 - Not Found

    The requested content appears to be script and will not be served by the static file handler.

    then you will need to ensure you have the Microsoft .NET Framework 3.5.1 options selected, from add remove programs, turn windows features on / off.

    image

  • Attaching a document template in Microsoft Word 2007

    Today I was attempting to update the template for my document. I struggled slightly as I couldn’t find where the attach template user interface dialog had been moved to. Turns out that it’s under the main button (which you normally go to for File, Save), under the Word options button. Then you have to navigate to Add-ins, and select Templates from the Manage drop down. Then you click the go button next to that, and you’ll end up at the familiar document template dialog that you’re used to from Office 2003 and before.

     

    image

    image

  • JetBrains Team City

    We’re currently using JetBrains Team city (http://www.jetbrains.com/teamcity/) to provide our CI (Continuous Integration) environment on our project. There are many reasons for choosing Team city for this purpose, over something like TFS Builds for example. One of the main reasons we choose it, was for its integration with Git as our source repository system.

    Usage

    We found it best to create a team city project per development branch in our Git source control repository. That way you could see your changes in isolation, and be notified if you’d broken you’re own local CI build, and therefore take the decision (kind of like a gated check in), as to whether or not to merge with the main source control branch. For additional usage instructions see the following sections.

    How to set the Server Email setting

    1. Log in as the administrator to the team city administration page http://yourserver/admin/admin.html
    2. Select the server configuration link
       image
    3. Select the email notification tab
       image
    4. Enter the email server setting as mySmtpServer.mydomain.com
    5. Enter the messages from setting as noreply-myserver@mydomain.com
    6. Test the connection and if all is working hit the save button.

    Best practices

    It’s good when working on a team project to know exactly when your (or someone else) has caused a CI build to fail. To this end you should really go to the tools section of your team city web site, and download the windows tray notifier.

    image

    You can also download a vista gadget from here http://www.teamcity-gadget.com/ which I find more useful myself, as it’s a simple one click access from the gadget hyperlink to your project.

    image

    Upgrade experience

    Recent releases have meant an upgrade has been necessary on our team city build server. This has been a simple experience of just downloading the latest team city release, and then just running the TeamCity executable installer. This automatically upgrades you to the latest version, keeping your configuration settings in tact.

    What’s even more impressive, is that once the build server restarts, any satellite servers you have set up as build agents for your builds, automatically upgrade to the compatible agent version too. One way you can verify this is actually the case is by comparing the installed team city version number against the number that the build agent reports.

    E.g. Installed version number found in add remove programs…

    image

    Build agent version number found on the team city

    image image

  • Post build event for copying a target dll to an extensions folder

    For example if you wish to create a MefExtensions directory for a main assembly to use the DirectoryCatalog to load in plugins at application startup then add this to your sub project's post build event

    SET DestDir=MefExtensions
    SET DestDir=$(SolutionDir)\$(SolutionName)\$(OutDir)%DestDir%\
    IF NOT EXIST %DestDir%. (md %DestDir%.) ELSE erase /Q /F %DestDir%$(TargetFileName)
    xcopy $(TargetPath) %DestDir% /C
  • A good WPF busy spinner indicator

  • Windows 7 TaskBarItemInfo in WPF for Progress bar style feedback

    In windows 7 you may have noticed when items are copying across in windows explorer, that you get a nice progress bar reported on your task bar for windows explorer. This can be achieved in your own WPF applications using the Window.TaskBarItemInfo dependency property as follows…

    http://msdn.microsoft.com/en-us/library/system.windows.shell.taskbariteminfo.aspx

    image

  • Snoop that works for WPF applications

    Most versions of snoop that I keep coming across have a problem updating the UI dynamically at runtime via the SNOOP property grid editor. Felix Corke recently pointed me in the direction of a fixed version…

    http://snoopwpf.codeplex.com/

    The most recent version 2.6.0, now just works out of the box. No longer do you have 4 versions for the different flavours of 32bit/64bit and .net 4.0 and .net 3.5, it just figures it all out for you since version 2.6.0 was released.

    The best news of all though, is that it now also works with wpf controls that are hosted inside a windows forms host control.

    Recommend installing that latest version if you’re currently doing wpf development.

  • Kuler colour theme selector

    If you’re having difficulties selecting a colour for your new web site or application, then use the following tool…

    image

    http://kuler.adobe.com/#create/fromacolor

    It’s great for devs, there is also a Expression Blend panel plugin for it http://jonas.follesoe.no/AnnouncingColorfulExpressionStudioAddIn.aspx

  • Reflection filling with Blend

    When you’re creating a reflection using a visual brush in xaml, then to create the mirrored effect, simply flip the filled rectangle vertically, and then set the OpacityMask to have the first stop at 0% alpha setting.

    image

  • Windows Phone Developer Tools (installation issues)

    If you have issues whereby the installation of Windows Phone Developer Tools wont install as it says it is already installed, when attempting to install the April refresh, then look here for the solution…

    Aaron Stebner's WebLog  XNA Game Studio Cleanup Tool User's Guide

    http://blogs.msdn.com/astebner/pages/9544320.aspx

  • Where did Help About go in Microsoft Office 2007?

    I needed to find the standard help about dialog in Excel 2007 the other day, and normally I would have just gone to the Help menu, but this strangely is now hidden under the Office button, Excel Options, Resources, About…

    image

  • Using d:DataContext design time expression with Visual Studio 2010 Xaml file editing

    Setting the design time datacontext in visual studio 2010 in your xaml file, makes intellitype work for a deep traversal of any of your view model properties...

    You can set the data context type to your view mode, and then data binding to your view model becomes as easy as using the property grid...

    <UserControl x:Class="EMC.Windows.AlarmsModule.UserControl1"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:AlarmsModule="clr-namespace:EMC.Windows.AlarmsModule" d:DesignHeight="300"
        d:DesignWidth="300"
                 d:DataContext="{d:DesignInstance Type=AlarmsModule:Alarm}"
        >

    For more information see 14:52 mins in on the Ian Griffiths video from Microsoft Tech day Rich client track (Thu 15 April).  http://www.microsoft.com/uk/techdays/daydev.aspx

    image

  • Using Windows 7 System Restore

    Recently I ran into issues with various versions of Visual Studio 2010 release candidates / betas / rtm for Expression Blend 4. I accidentally installed the RTM version of Blend when I was still only using RC version of Visual Studio 2010. This led to all sorts of issues with Visual Studio 2010 RC, crashing unexpectedly, running low on virtual memory and not performing well, as well as just refusing to even start! Tracked this down to the version of the .Net framework 4 having been updated, and subsequently before every major install I put on my machine now, I create a restore point manually, so I know I can revert to this if things should start going pear shaped. (Note: this is the automatic behaviour when you install any Windows Installer Service (msi) based program).

    To create a restore point, you can simply type “create a restore point” in the windows start menu, which takes you to this dialog, where you simply need to hit the create button.

    image

    To restore your system to a previous point in time (note: this doesn’t remove any documents that you created between the restore points), simply type “system restore” at the windows start menu,

    image

    choose a different restore point, and then select your manual restore point

    image

Powered by Community Server (Personal Edition), by Telligent Systems