Shawn Cicoria - CedarLogic

Perspectives and Observations on Technology

Recent Posts

Sponsors

Tags

General





Community

Email Notifications

Blogs I Read

Archives

Other

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…

 

clip_image002 

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

http://msdn.microsoft.com/en-us/magazine/dn189203.aspx

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: http://vsartesttoolingguide.codeplex.com/releases/view/102290

http://blogs.msdn.com/b/willy-peter_schaub/archive/2013/03/01/better-unit-testing-with-microsoft-fakes-guide-shipped.aspx

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

http://mikefourie.wordpress.com/2013/03/05/creating-the-better-unit-testing-with-microsoft-fakes-ebook/

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:

Foreword

Introduction

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

Appendix

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…

http://www.modern.ie/virtualization-tools

Updating your TFS Service urls to from TfsPreview.com to VisualStudio.com

If you haven’t heard, TFS Service has gone live at http://tfs.visualstudio.com/.

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

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

http://blog.jessehouwing.nl/2012/11/updating-your-team-foundation-service.html

Here’s the script as well.

 



Get-ItemProperty -Path HKCU:\Software\Microsoft\VisualStudio\*\TeamFoundation\Instances\*.tfspreview.com Uri | %{set-itemproperty -Path $_.PSPath Uri -Value ( $_.Uri -Replace ".tfspreview.com/", ".visualstudio.com/" )}
 
Get-ItemProperty -Path HKCU:\Software\Microsoft\VisualStudio\*\TeamFoundation\Instances\*.tfspreview.com\Collections\* Uri | %{set-itemproperty -Path $_.PSPath Uri -Value ( $_.Uri -Replace ".tfspreview.com/", ".visualstudio.com/" )}
 
Get-ChildItem -Path HKCU:\Software\Microsoft\VisualStudio\*\TeamFoundation\Instances\*.tfspreview.com | Rename-Item -NewName { $_.PSChildName -Replace ".tfspreview.com$", ".visualstudio.com" }
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:

http://jabbr.net/#/rooms/signalr

Other links

https://github.com/SignalR/SignalR

http://www.hanselman.com/blog/AsynchronousScalableWebApplicationsWithRealtimePersistentLongrunningConnectionsWithSignalR.aspx

http://signalr.net/

Good overview of what’s included here:

http://weblogs.asp.net/jgalloway/archive/2012/10/31/ten-oh-wait-eleven-eleven-things-you-should-know-about-the-asp-net-fall-2012-update.aspx?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+jongalloway+%28Jon+Galloway%29

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

http://support.microsoft.com/kb/2744926

Upgrading from Visual Studio 2012 RC to RTM

http://blogs.msdn.com/b/heaths/archive/2012/08/17/upgrading-from-visual-studio-2012-rc-to-rtm.aspx

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)

http://msdn.microsoft.com/en-us/library/windows/apps/hh758314.aspx

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 : http://blogs.msdn.com/b/vbertocci/archive/2012/03/15/windows-identity-foundation-in-the-net-framework-4-5-beta-tools-samples-claims-everywhere.aspx

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

[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\Debugger]
"DisableAttachSecurityWarning"=dword:00000001

[HKEY_CURRENT_USER\Software\Wow6432Node\Microsoft\VisualStudio\10.0\Debugger]
"DisableAttachSecurityWarning"=dword:00000001
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(
            rstr2.RequestedSecurityToken.SecurityTokenXml,
            new BinarySecretSecurityToken(
                rstr2.RequestedProofToken.ProtectedKey.GetKeyBytes()),
            lifetime.Created.HasValue ? lifetime.Created.Value : DateTime.MinValue,
            lifetime.Expires.HasValue ? lifetime.Expires.Value : DateTime.MaxValue,
            rstr2.RequestedAttachedReference,
            rstr2.RequestedUnattachedReference,
            null);
    }

}
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 »