INTELLIGENT.TECHNICAL.ARCHITECTURE.TRAINING

 
 
Blogs:
 
 

Archive for the ‘Blog’ Category

August 29, 2014 / No Comment
AUTHOR:
CATEGORY: .Net, Blog, C#

There are two new exception-handling features in C# 6.0.  The first is an improvement in the async and await syntax and the second is support for exception filtering.

When C# 5.0 introduced the async and await (contextual) keywords, developers gained a relatively easy way to code the Task-based Asynchronous Pattern (TAP) in which the compiler takes on the laborious and complex work of transforming C# code into an underlying series of task continuations.  Unfortunately, the team wasn’t able to include support for using await from within catch and finally blocks in that release.   As it turned out, the need for such [...]

Read more

Declaration Expressions in C# 6.0

August 29, 2014 / No Comment
AUTHOR:
CATEGORY: .Net, Blog, C#, Uncategorized

It’s not uncommon that in the midst of writing a statement, you find you need to declare a variable specifically for that statement.  Consider two examples:

  • In the midst of coding an int.TryParse() statement, you realize you need to have a variable declared for the out argument into which the parse results will be stored.
  • While writing a for-statement, you discover the need to cache a collection (such as a LINQ query result) to avoid re-executing the query multiple times.  In order to achieve this, you interrupt the thought process of writing the for-statement to declare a variable.
  • To address these and similar [...]

    Read more

    Static Using Statement in C# 6.0

    August 29, 2014 / No Comment
    AUTHOR:
    CATEGORY: .Net, Blog, C#

    Another C# 6.0 “syntactic sugar” feature is the introduction of using static.  With this feature, it’s possible to eliminate an explicit reference to the type when invoking a static method.  Furthermore, using static lets you introduce only the extension methods on a specific class, rather than all extension methods within a namespace.  The code of Listing 1 below provides a “Hello World” example of using static on System.Console.

    In this example, the Console qualifier was dropped a total of 9 times.  Admittedly, the example is contrived, but even so, the point is clear.  Frequently a type prefix on a static member (including [...]

    Read more

    Relative Paths for Visual Studio Generic Tests

    October 20, 2013 / No Comment
    AUTHOR:
    CATEGORY: .Net, ALM, Blog, C#, Visual Studio

    To make generic tests robust enough to run for all developers on your team and on the build server, you are likely going to want to avoid hard coding the path to the executable.  To do this successfully, you need to have a list of all the environment variables that are available when the test executes.  These can be obtained by creating a generic test with the existing program as %COMSPEC% (the fully pathed location for cmd.exe) and setting “/C set” as the Commnd-line arguments.  The result, with all standard environment variables pulled out, is as follows:

    Where I have substituted the following values:

    Of [...]

    Read more

    Visual Studio 2012 Presenter Mode

    November 9, 2012 / 1 Comment
    AUTHOR:
    CATEGORY: Blog, Visual Studio

    For those of us frequently presenting, we are faced with having to switch to presenter fonts by changing the font size for multiple different display items on the Environment->Fonts and Colors Options dialog or (if we are looking for an adequate but not optimal solution) simple changing the zoom level.  Of course, when we get back to our desks, we have to switch back the settings to fit with our 3 monitor 2560 × 1600 WQXGA resolution (purely hypothetical in my case).

    To streamline the change the November release of the Visual Studio Productivity Power Tools 2012 (see [...]

    Read more

    Deleting Moldy Shelvesets

    October 20, 2012 / 1 Comment
    AUTHOR:
    CATEGORY: Blog, PowerShell, TFS

    If you have had a Team Foundation Server (TFS) instance running for any significant length of time you undoubtedly have old shelvesets lying around from other developers (surely you wouldn’t have done this) that have long ago expired and although moldy, they have not disintegrated. Consider cleaning them up using the following short PowerShell script from Kelly Adams:

    Note:

  • The “-Owner *” on the Get-TfsShelveset command is what finds shelvesets from other developers rather than just yourself.
  • You need to have the Team Foundation Server PowerTools installed and the snapin loaded (using Add-PSSnapin Microsoft.TeamFoundation.PowerShell) in an x86 PowerShell command prompt.
  • Read more

    Removing Duplicate Entries from %PATH%

    June 30, 2012 / 2 Comments
    AUTHOR:
    CATEGORY: PowerShell, Windows

    As developers, we frequently end up with duplicate entries in our path. From the command line you can clean up your path using pathman.exe. Here’s a PowerShell Script to find the duplicates and remove them using Pathman.exe:

    $extraPath=(($path.Split(“`;”) | group | ?{$_.Count -gt 1}).Values | %{$_[0]}
    pathman.exe /ru $extrapath

    Disclaimer: Works for us.

    IntelliTect Presents at the Seattle Code Camp 2012

    June 15, 2012 / No Comment
    AUTHOR:

    Asynchronous Programming with C# 5.0Mark Michaelis
    In C# 5.0 there is really only one significant syntax addition – support for asynchronous programming that is embedded into the language. In this session we go over the is and is-nots of what C# 5.0 enables in the way of parallel processing – both for the UI and for the server tier. Don’t miss this session to learn not only the fundamental syntax but also the best practices and scenarios of what the async keyword enables.

    PowerShell for DevelopersMark Michaelis & Read more

    GIST: Windows Server “8” Administrative Experience

    April 3, 2012 / No Comment
    AUTHOR:

    There are several items that deserve highlighting from Erin Chapple’s post (via Jeffry Snover) titled, “Rocking the Windows Server “8” Administrative Experience”.  Here’s my gist:

  • Administration designed for one a single-role centric view to a multi-server view of the environment.  The result is that rather than administer a role on a particular server you will now be able to administer a role that may span multiple servers.
  • The PowerShell based Command-line Interface (CLI) for Windows administration is a both/and experience – both CLI and GUI.
  • CLI automation increases reliability, auditability, and predictability – across multiple servers none-the-less.
  • Server Core is the preferred [...]
    Read more

  • Turning on Continuous Testing in Visual Studio 11

    March 2, 2012 / No Comment
    AUTHOR:
    CATEGORY: .Net, Blog, C#, Visual Studio

    The new unit testing explorer support has a new unit test explorer has a Run dropdown for selecting which text to execute (see Figure 1).

    In addition, Visual Studio 11 supports continuous testing – automatically running your tests every time you compile your code.  However, as shown in Figure 1, the option to enable continuous testing doesn’t appear from the Run dropdown (and probably shouldn’t because you are not likely to be changing the option back and forth that often).  To enable continuous testing, select the Unit Test->Unit Test Settings->Run Tests After Build menu as shown in Figure 2.

     

    IntelliTect Corporation
    3024 S. Bannen Ct.
    Spokane Valley, WA  99037

    Phone: (509) 315-3400
    Email: info@intelliTect.com

      COPYRIGHT © 2006-2012 INTELLITECT. ALL RIGHTS RESERVED.