Accessing a .NET bot’s state via dependency injection

When using the .NET BotBuilder SDK’s dialog system, you can access the bot state using the dialog context, but what if you don’t have the dialog context handy? You have two options Pass the context around all the time Use the already built in IoC container to get the bot state. With v3 of the…

0

Async Main() is available, but hidden

How did I miss this? I love C# and I try to keep up with the latest features. What I didn’t realize until recently is that the C# 7.1 features are already released. And C# 7.1 includes asynchronous Main methods. Awesome! By default, new projects in Visual Studio only work with the latest major version…

1

Setting up Xamarin Live Player

[UPDATE] You no longer need the preview version of Visual Studio. Updated directions can be found in the  Xamarin documentation [ORIGINAL] Xamarin Live Player is a new tool that allows you to live edit an application running on an Android or iOS device. The interesting bit for many, is that you don’t need a Mac…

7

An alternative to ConfigureAwait(false) everywhere

One of the general recommendations you may often read is to use ConfigureAwait(false) in library code. This is so that when the library is used, it does not block the synchronization context in use by the application (e.g. the UI thread). If the library doesn’t know anything about the app, it doesn’t depend on the…

16

Quick dev directory cleanup tip

When cleaning up drive space, the first thing I do is remove the ‘obj’, ‘bin’, and ‘packages’ directories from my development directories. They are temporary and will be rebuilt the next time I build the related project. Because I end up with a lot of little test & sample projects that I don’t refer to…

0

Asynchronous infinite loops instead of timers

Did it occur to you that an infinite loop, with async/await inside it, isn’t really an infinite loop? It looks like one (which is usually bad) but because of the asynchrony, we know that it isn’t executing the entire method at one time. Part executes now, then sometime later it periodically resumes – that sounds kind…

2

Waaaaay oversimplified async/await plumbing

Often, when someone asks “how does this async await stuff actually work”? There is a lot of hand waving or someone says “just use reflection and look at it” but the real compiled code is a complex recursive state machine. So I want to show a (relatively) simplified example that isn’t the real thing but…

0

Windows Live Writer lives on as Open Live Writer!

I am happy to be posting this blog entry from the newly announced Open Live Writer! The most excellent blogging tool has not been actively developed for some time. But efforts have been made and now a fork of that well loved application is now provided as the open source project Open Live Writer under…

0

Tasks are (still) not threads and async is not parallel

I talk to a lot of developers who are either new to .NET or are moving from an older version to the newer platform and tools. As such I’m always trying to think of new ways to describe the nature of Tasks vs Threads and async vs parallel. Modern .NET development is steeped in the…

14

Visual Studio Tip #9: You can edit directly in the Diff tool

Here is one I just discovered just last week by accident. When you are doing a diff on a file to compare what has changed from the source control, the diff window can be used to edit the file directly. (works on both Git and TFS source control) I always assumed the window was just…

3