Tag: C#

  • Profile a Unit Test in Visual Studio Fails with “File contains no data buffers”

    Profile a Unit Test in Visual Studio Fails with “File contains no data buffers”

    Visual Studio has a fantastic feature in it that lets you quickly run the performance profiler against a unit test. Got a test that is running slow and you want to find out why? Go to Test Explorer, right-click that test and choose Profile. That’ll automatically run that test with the profiler attached. It usually…

  • Some Model Properties Not Binding in ASP.NET MVC Core

    Some Model Properties Not Binding in ASP.NET MVC Core

    [TL/DR? – skip to the bottom] I ran into a problem with an ASP.NET MVC Core app today and it took me a while to figure it out. Here’s the problem: on an extremely simple and straightforward form, I couldn’t get a field in my model to POST back to the server. Every time that…

  • Some Useful Visual Studio Code Snippets

    Some Useful Visual Studio Code Snippets

    Update: June 20, 2019 — Here’s an updated version of this post and the snippets including support for Visual Studio and Visual Studio for Mac. A couple of months ago, I got inspired to really learn .NET Core and Visual Studio Code (VSCode).  But I didn’t just want to learn it from Windows — the…

  • Slides & Code from VSLive Austin 2018: “Unit Testing for Mere Mortals”

    Slides & Code from VSLive Austin 2018: “Unit Testing for Mere Mortals”

    I just wrapped up my talk at VSLive Austin 2018 — “Unit Testing & Test-Driven Development (TDD) for Mere Mortals”.  Thanks to all the attendees for the great questions. As promised, here are my slides and code samples. Unit Testing & Test-Driven Development (TDD) for Mere Mortals Unit Testing and Test-Driven Development (TDD) arguably mean…

  • VSLive Orlando 2017: Unit Testing for Mere Mortals Slides & Code

    VSLive Orlando 2017: Unit Testing for Mere Mortals Slides & Code

    I just wrapped up my talk at VSLive Orlando 2017 — “Unit Testing & Test-Driven Development (TDD) for Mere Mortals”.  Thanks to all the attendees for the great questions. As promised, here are my slides and code samples. Unit Testing & Test-Driven Development (TDD) for Mere Mortals Unit Testing and Test-Driven Development (TDD) arguably mean…

  • VSLive Redmond 2017: Unit Testing for Mere Mortals Slides & Code

    VSLive Redmond 2017: Unit Testing for Mere Mortals Slides & Code

    I just wrapped up my talk at VSLive Redmond 2017 — “Unit Testing & Test-Driven Development (TDD) for Mere Mortals”.  Thanks to all the attendees for the great questions. As promised, here are my slides and code samples. Unit Testing & Test-Driven Development (TDD) for Mere Mortals Unit Testing and Test-Driven Development (TDD) arguably mean…

  • VSLive Vegas 2016: Unit Testing for Mere Mortals Slides & Code

    VSLive Vegas 2016: Unit Testing for Mere Mortals Slides & Code

    I just wrapped up my first talk at VSLive Las Vegas 2016 — “Unit Testing & Test-Driven Development (TDD) for Mere Mortals”.  Thanks to all the attendees for the great questions — especially the discussion we got in to about unit testing private methods. As promised, here are my slides and code samples. Unit Testing…

  • Automatic Exception Handling on ICommand ViewModel Properties

    Automatic Exception Handling on ICommand ViewModel Properties

    If you’re writing a WPF application or some other XAML-based application, you’re probably using the Model-View-ViewModel (MVVM) pattern.  If you’re being “good” about your MVVM implementation, you’re putting all your button click handling code into ICommand properties on your ViewModels.  (What!? You’re not doing that?  Naughty naughty!  You should!  It makes it so much more…

  • Slides from “How to be a C# Ninja” at Visual Studio Live Orlando 2013

    I spoke at VSLive Orlando 2013 last month and did a talk called “How to Be a C# Ninja in 10 Easy Steps”.  How to Be a C# Ninja in 10 Easy Steps Are you new to C# and want to get awesome? Are you pretty good at C# and want to raise your game?…

  • XML utility methods for C#

    It’s tough to work on a project that doesn’t involve XML.  XML is everywhere and I kept needing to do the same things again and again from project to project.  I took my C# XML utility methods, converted them to extension methods, and then put them into a class that I could drop in to…