Shawn Cicoria - CedarLogic

Perspectives and Observations on Technology

Recent Posts





Email Notifications

Blogs I Read



Use OpenDNS

eBook on SignalR…


signalR-ebook-done - campusMVP.Net | campusMVP.Net

Visual Studio IE Debug with No Add-ons


Sometimes you need IE with no-adds.  For example, colleague of mine was crashing – won’t say which add-on caused it, but easily enough, add a choice to run IE with No-Addons in VS2012.


Just add an entry to your Browse with to

ProgramFiles(x86)\Internet Explorer\iexplore.exe

with the  -extoff parameter…



Take a brief look at the Agile management features in TFS 2012

Team Foundation Server

Agile Project Management using TFS 2012

Suliman Battat

Cleaning up IIS Express Sites

Over time, you may end up with lots of sites running in IIS Express.  I like things neat and tidy, and periodically, I’ll run a little cleanup command as follows:

From PowerShell:

$appCmd = "C:\Program Files (x86)\IIS Express\appcmd.exe"

$result = Invoke-Command -Command {& $appCmd 'list' 'sites' '/text:SITE.NAME' }

for ($i=0; $i -lt $result.length; $i++)
    Invoke-Command -Command {& $appCmd 'delete' 'site'  $result[$i] }
eBook - Better Unit Testing with Microsoft Fakes–available now…

I was fortunate enough to work on a team for the past year on producing an eBook that covers the Microsoft Fakes Framework that shipped as part of Visual Studio 2012.  Note that Fakes is or will be available in the Premium edition of VS2012 with Update 2.

Download the guide:

Mike Fourie was the lead on this, and w/ out Mike, this wouldn’t be where it is today…

The team was made up of ALM Rangers from Microsoft and partners, providing a broad based set of experiences that helped shape the guide towards real world scenarios.

Brian Blackman, Carsten Duellmann, Dan Marzolini, Darren Rich, David V. Corbin, Hamid Shahid, Hosam Kamel, Jakob Ehn, Joshua Weber, Mehmet Aras, Patricia Wagner, Peter Provost, Richard Albrecht, Richard Fennell, Rob Jarratt, Shawn Cicoria, Waldyr Felix, Willy-Peter Schaub

Here’s the TOC:



Chapter 1: A Brief Theory of Unit Testing

  • Software testing

  • The fine line between good and flawed unit testing

Chapter 2: Introducing Microsoft Fakes

  • Stubs
  • Shims
  • Choosing between a stub and a shim

Chapter 3: Migrating to Microsoft Fakes

  • Migrating from Moles to Microsoft Fakes
  • Migrating from commercial and open source frameworks

Chapter 4: Miscellaneous Topics

  • Targeting Microsoft .NET Framework 4
  • Adopting Microsoft Fakes in a team
  • You can’t Fake everything!
  • Verbose logging
  • Working with strong named assemblies
  • Optimizing the generation of Fakes
  • Looking under the covers
  • Refactoring code under test
  • Removing Fakes from a project
  • Using Fakes with Team Foundation Version Control
  • Using Microsoft Fakes with ASP.NET MVC

Chapter 5: Advanced Techniques

  • Dealing with Windows Communication Foundation (WCF) service boundaries
  • Dealing with non-deterministic calculations
  • Gathering use-case and other analytical information
  • Analyzing internal state
  • Avoiding duplication of testing structures

Chapter 6: Hands-on Lab

  • Exercise 1: Using Stubs to isolate database access (20 – 30 min)
  • Exercise 2: Using Shims to isolate from file system and date (20 – 30 min)
  • Exercise 3: Using Microsoft Fakes with SharePoint (20 – 30 min)
  • Exercise 4: Bringing a complex codebase under test (20 – 30 min)

In Conclusion


Querying a SharePoint 2013 Task List for Subtasks

The CAML for the query easily enough includes a ParentID reference.  However, if you’re spelunking around in SP 2013 using the OData services, you might have a hard time finding the ParendID field.

However, if you just issue the query:

https://<server>/<mp>/web/_api/Web/Lists/getByTitle('TaskListName')/Items/?$filter=ParentID eq ‘101’

You’ll be able to retrieve all Tasks that have task #101 as their parent.

Get your VHD images for testing–all prepped and ready to go…


IE6 – WinXP, IE7 – Vista, IE8 – Win7, IE9 – Win7, and IE10 – Win8…

Updating your TFS Service urls to from to

If you haven’t heard, TFS Service has gone live at

While the old DNS name works, at some point it may retire.

So, Jesse Houwing has a post/script that makes it easy.

Here’s the script as well.


Get-ItemProperty -Path HKCU:\Software\Microsoft\VisualStudio\*\TeamFoundation\Instances\* Uri | %{set-itemproperty -Path $_.PSPath Uri -Value ( $_.Uri -Replace "", "" )}
Get-ItemProperty -Path HKCU:\Software\Microsoft\VisualStudio\*\TeamFoundation\Instances\*\Collections\* Uri | %{set-itemproperty -Path $_.PSPath Uri -Value ( $_.Uri -Replace "", "" )}
Get-ChildItem -Path HKCU:\Software\Microsoft\VisualStudio\*\TeamFoundation\Instances\* | Rename-Item -NewName { $_.PSChildName -Replace "$", "" }
Posted: 11-03-2012 5:07 AM by cicorias | with no comments
Filed under:
RealTime communication with SingalR…

The upcoming Fall Release of VS2012 has some really great updates, bringing back OData, SPA, and now SingnalR.

If you get a chance take a look at Scott Guthrie’s keynote session where he goes through it (SignalR -- along with a demo of New Relic – which rocks).

SignalR is a hub/client model that leverages javascript to provide real time broadcast and point to point call backs from the hub to clients.  So, you can make some really cool sh**t with it.

Here’s a simple chat that was done with just a few lines of code:

Other links

Good overview of what’s included here:

Posted: 11-02-2012 4:38 AM by cicorias | with no comments
Filed under: , ,
Starting fresh with the Visual Studio 2012 RTM bits…

Sometimes you can’t do a clean install of the OS and move to Win8 RTM.  One of my machines I’ll be using for an ongoing project it’s in that “perfect” operating mode – except for the RC versions of Visual Studio 2012.

The following links provide the upgrade paths as needed (note that with Win8 – must move to RTM of Win8 to get VS2012 RTM.

How to uninstall Visual Studio 2012 Release Candidate

Upgrading from Visual Studio 2012 RC to RTM

Posted: 08-19-2012 6:20 AM by cicorias | with no comments
Filed under:
Good use of the Charms Bar in Windows 8 Metro.

If you’re using Win8 yet, no doubt you’ve run into the charms bar.  There’s a feature to extend via Share, links to your application.

Details on the HOW are here:

Adding share (Metro style apps using JavaScript and HTML)

So, Digital Folio has taken their shopping tool to Win8 and enabled some really cool ways to take advantage.  I was fortunate enough to help out the folks there a while back on some other things, but their app is a nice shoppers aid.

Digital Folio for Windows 8 | Instant Price Comparisons from Major Retailers on the Products You Want

Posted: 07-05-2012 11:24 AM by cicorias | with no comments
Filed under: ,
Updated WIF tools for VS2012 RC are out–be safe…

The updated tools for the RC along with the samples are out.  The samples from the prior 1.0 release will still work as well

Windows Identity Foundation Tools for Visual Studio 2012 RC - Vibro.NET - Site Home - MSDN Blogs

Samples are at the bottom :

Posted: 06-20-2012 5:14 AM by cicorias | with no comments
Filed under: , , ,
Turning off the Visual Studio “Attach to process” security warning…

When you’re urnning under x64 you have to affect 1 addition spot in the registry to disable this warning – which clearly should only be done by folks that know what they’re doing.

NOTE: affecting the registry can be harmful – do so at your own risk.

Windows Registry Editor Version 5.00

Windows Registry Editor Version 5.00


Getting a SecurityToken from a RequestSecurityTokenResponse in WIF

When you’re working with WIF and WSTrustChannelFactory when you call the Issue operation, you can also request that a RequestSecurityTokenResponse as an out parameter.

However, what can you do with that object?  Well, you could keep it around and use it for subsequent calls with the extension method CreateChannelWithIssuedToken – or can you?

public static T CreateChannelWithIssuedToken<T>(this ChannelFactory<T> factory, SecurityToken issuedToken);


As you can see from the method signature it takes a SecurityToken – but that’s not present on the RequestSecurityTokenResponse class.

However, you can through a little magic get a GenericXmlSecurityToken by means of the following set of extension methods below – just call

rstr.GetSecurityTokenFromResponse() – and you’ll get a GenericXmlSecurityToken as a return.

public static class TokenHelper

    /// <summary>
    /// Takes a RequestSecurityTokenResponse, pulls out the GenericXmlSecurityToken usable for further WS-Trust calls
    /// </summary>
    /// <param name="rstr"></param>
    /// <returns></returns>
    public static GenericXmlSecurityToken GetSecurityTokenFromResponse(this RequestSecurityTokenResponse rstr)
        var lifeTime = rstr.Lifetime;
        var appliesTo = rstr.AppliesTo.Uri;
        var tokenXml = rstr.GetSerializedTokenFromResponse();
        var token = GetTokenFromSerializedToken(tokenXml, appliesTo, lifeTime);
        return token;

    /// <summary>
    /// Provides a token as an XML string.
    /// </summary>
    /// <param name="rstr"></param>
    /// <returns></returns>
    public static string GetSerializedTokenFromResponse(this RequestSecurityTokenResponse rstr)
        var serializedRst = new WSFederationSerializer().GetResponseAsString(rstr, new WSTrustSerializationContext());
        return serializedRst;

    /// <summary>
    /// Turns the XML representation of the token back into a GenericXmlSecurityToken.
    /// </summary>
    /// <param name="tokenAsXmlString"></param>
    /// <param name="appliesTo"></param>
    /// <param name="lifetime"></param>
    /// <returns></returns>
    public static GenericXmlSecurityToken GetTokenFromSerializedToken(this string tokenAsXmlString, Uri appliesTo, Lifetime lifetime)
        RequestSecurityTokenResponse rstr2 = new WSFederationSerializer().CreateResponse(
        new SignInResponseMessage(appliesTo, tokenAsXmlString),
        new WSTrustSerializationContext());
        return new GenericXmlSecurityToken(
            new BinarySecretSecurityToken(
            lifetime.Created.HasValue ? lifetime.Created.Value : DateTime.MinValue,
            lifetime.Expires.HasValue ? lifetime.Expires.Value : DateTime.MaxValue,

Learn More about Microsoft Codename "Trust Services" - TechNet Articles - Home - TechNet Wiki

Many companies, ISV’s, and solutions have concerns about data in the cloud.  With PKI based encryption, Trust Services provides key management for your publisher/subscribers and a simplified SDK set of classes to abstract the encryption, decryption process.  Both managed classes and PowerShell add-in provided...

Learn More about Microsoft Codename "Trust Services" - TechNet Articles - Home - TechNet Wiki

Posted: 02-04-2012 6:50 AM by cicorias | with no comments
Filed under: ,
More Posts « Previous page - Next page »