A first look at SignalR



Last month I finally had a chance to use SignalR in a live project for the first time, and I've been impressed by what this technology offers to .NET developers. It's easy to use and provides rich real-time two way messaging between client and server applications, as well as the ability to broadcast message to all connected clients. This is technology that offers many opportunities to rethink of what we can build with Web applications.

Read more...



Publish Individual Files to your Server in Visual Studio 2012.2



Visual Studio 2012 Update 2 introduces a little known new Web Publish feature that allows publishing individual files to the server. While not a high frequency usage case, it's handy for content files or when you just published a large project and realized you forgot to include a file in the project to publish.

Read more...



A WebAPI Basic Authentication MessageHandler



In my last post I showed how to create a basic authentication filter for custom authentication within your applications. This time I repeat the excercise with a MessageHandler to demonstrate the differences between the two approaches.

Read more...



A WebAPI Basic Authentication Authorization Filter



Recently I needed to implement user based security in a Web API application that's easily accessible from a variety of clients. The customer asked specifically for Basic Auth support and so needed to implement custom Basic Auth support. In this post I describe a simple AuthorizationFilter based implementation of Basic Authentication for Web API.

Read more...



WebAPI: Getting Headers, QueryString and Cookie Values



Finally got tired to trying to remember how to get at the Headers, Cookies and QueryString 'collections' in Web API, since there's zero consistency and messy nested collections to deal with. Here's are a set of extension methods that make it easier.

Read more...



UNC Drive Mapping Failures: Network name cannot be found



Ran into a nasty issue yesterday trying to map a remote drive via UNC pathing. Basically I was unable to connect with failures occurring instantly and without prompting for credentials even when asking to use different credentials. Turns out the problem is the Network Provider Order - here's more info.

Read more...



A small, intra-app Object to String Serializer



On a few occasions I've needed a very compact serializer for small and simple, flat object serialization, typically for storage in Cookies or a FormsAuthentication ticket in ASP.NET. XML and JSON serialization are too verbose for those scenarios so a simple property serializer that strings together the values was needed. Originally I did this by hand, but here is a class that automates the process.

Read more...



Experimenting with Online Backups



I recently spent a bit of time looking at online synching/backup software to provide a little more resilience to my backup situation. Lots of choices but nothing that's really quite perfect yet. Here's what I found.

Read more...



Firing an Entity Framework Database Initializer from within DbContext



Database initializers in Entity Framework can be a pain, especially when you're using EF as part of smaller components that may or may not load into a database shared with other EF Contexts. Here's a small helper utility that lets you internalize the database initializer and fire it the first time the context is loaded.

Read more...



Text Editor Associations/Extensions in Visual Studio getting lost



Visual Studio allows you to create text editor extensions that map standard Visual Studio editors to custom extensions. It's a useful feature that I use a lot with some older products, but unfortunately I've seen alot of cases where the editor/extension mapping gets lost even though Visual Studio still shows it as registered. Here's more info on the problem and how to fix it at least temporarily.

Read more...



Using plUpload to upload Files with ASP.NET



plUpload is a popular client side multi-file upload component. In this article I describe a small library that abstracts the server side processing of uploaded files with an HTTP handler demonstrate putting it all together with a small Image Upload sample application.

Read more...



Sql Connection Strings in .Config Files vs. Source Control



Connection strings in projects under source control can be problematic. Each Source Control user can potentially have different connection settings to use a database connection and these differences can't be easily reconciled via Source Control. Here are a couple of approaches that have worked for me to deal with this issue.

Read more...



Visual Studio Web Publish Lockup? Check for invisible Window



If your Web Publish dialog appears to lock up Visual Studio when you click on the Publish option, most likely the Web Publish window is hidden on a second screen that is not currently visible. Here's how you can work around this annoying little bug.

Read more...



Building a better .NET Application Configuration Class - revisited



Managing configuration settings is an important part of successful applications. It should be easy to ensure that you can easily access and modify configuration values within your applications. If it's not - well things don't get parameterized as much as they should. In this post I discuss a custom Application Configuration class that makes it super easy to create reusable configuration objects in your applications using a code-first approach and the ability to persist configuration information into various types of configuration stores.

Read more...



Process.Start() and ShellExecute() fails with URLs on Windows 8



It appears that on Windows 8 there's a bug in the ShellExecute() API that causes failure in URL navigation when running under Administrative privileges.

Read more...



A Small Utility to Delete Files recursively by Date



After again searching for a script or tool that can easily delete files recursively down a folder hierarchy with a date filter and coming up with several 'almost there' solutions I sat down and created a small Console app that handles this task. I've posted the resulting project on Github, with both the binary and source code, in case you ever find yourself with the same need.

Read more...



Set-Cookie Headers getting stripped in ASP.NET HttpHandlers



Ran into a nasty problem with Cookies not getting sent in HttpHandler code when using Response.AppendHandler() with the Set-Cookie key. It turns out it's a very narrow edge case, but one that can bite in unexpected system level applications.

Read more...



WCF WS-Security and WSE Nonce Authentication



I ran into a Web Service last week that required WS-Security headers with an embedded nonce value. Unfortunately WCF doesn't support this particular protocol directly. Here's how to create custom credentials and a tokenizer to write out the customized WS-Security header.

Read more...



Windows 8 Live Accounts and the actual Windows Account



When you log on with a Windows Live account in Windows 8, what really happens to your credentials? It's not quite obvious, so here are a few thoughts and examples that demonstrate the relationship between Windows and Live accounts.

Read more...



DevConnections Session Slides, Samples and Links



Finally getting around to posting links to my DevConnections session in Vegas a couple of weeks ago. It was a fun time after a long absence from speaking...

Read more...



HTML5 Input type=date Formatting Issues



The new HTML5 Input types make it easier to display special formatted input types like dates and email addresses. Browsers that support them display a nice UI for editing and can validate values. However, support currently is limited and date formatting especially is complex as it involves using an ISO date format that doesn't fall back nicely to non-supporting browsers.

Read more...



Back to Basics: When does a .NET Assembly Dependency get loaded



Assembly loading in .NET is often a cause of confusion. So many times I've heard how evil it is to add a reference to some big assembly, if it's just a minor feature. But .NET is really smart in assembly loading and by default uses just in time loading of referenced assemblies. In this post I review when assemblies are loaded with a few simple examples that demonstrate the process.

Read more...



Caveats with the runAllManagedModulesForAllRequests in IIS 7/8



IIS 7 and 8 support using Managed Modules to handle access to all IIS request content which is very powerful. But sometimes you actually want to not handle non-ASP.NET content and it's not very obvious how to minimize access to non-ASP.NET requests in managed modules.

Read more...



Dynamic Code for type casting Generic Types 'generically' in C#



Here's a short entry on how dynamic can be a life saver when you can't cast a type between multiple objects, specifically when the object in question is a generic type without a common base type to cast to.

Read more...



A tiny Utility to recycle an IIS Application Pool



Here's a small console app to recycle an Application Pool which seems to be something I've needed to do repeatedly in the past.

Read more...




West Wind  © Rick Strahl, West Wind Technologies, 2005 - 2013