Contact   •   Articles   •   Products   •   Search

Rick Strahl's Web Log

Wind, waves, code and everything in between...
ASP.NET • C# • HTML5 • JavaScript • AngularJs

Bitmap types, Binary Resources and Westwind.Globalization



I've been working on supporting binary resource imports via the Web interface using Westwind.Globalization and I'm debating on whether supporting the .NET convention of importing image resources as Bitmaps is prudent. Bitmaps are rather unwieldy to use and are painful to export to common stream or file formats due to the funky 30 year old encoding architecture used by GDI+. In this post I talk about some of the issues I've run into with Bitmaps and why I'm considering importing resources simple as raw byte data.

Read more...

Updated DeleteFiles Utility now on Chocolatey



I've updated my DeleteFiles utility that can be used to recursively delete files and folders. I've recently updated the utility with a few new features including support for long paths (greater than MAX_PATH) that can choke out Explorer and other Windows shells. There are also additional options for previewing and recycle bin support as well quiet command line mode and a few improvements in the timeout filter for file selection. Last but not least, you can now install DeleteFiles directly from Chocolatey so it's easy to load DeleteFiles and get it onto your system and system path in seconds.

Read more...

ASP.NET MVC, Localization and Westwind.Globalization for Db Resources



Recently I've been getting a number of questions related to customers having issues with running the Westwind.Globalization Database Resource provider library under ASP.NET MVC. While the original versions of this library were definitely WebForms centric since it originated in the WebForms era, the library has had full support for ASP.NET MVC for a while. In this post I'll review how localization works in ASP.NET MVC and then demonstrate how Westwind.Globalization handles the same scenarios with database resources.

Read more...

Cordova and Visual Studio CODE Magazine Article



Looks like my "Taming Mobile Apps with Cordova and Visual Studio" article went live recently. If you want to find out how to use the new and pretty awesome Visual Studio Tools for Apache Cordova for building Web based, hybrid Mobile apps, this article is a great starting point. The article gives an overview of Cordova and then walks through examples with special focus on building iOS apps.

Read more...

Using FontAwesome Fonts for HTML Radio Buttons and Checkboxes



Spruce up your boring checkboxes and radio buttons with custom FontAwesome symbols using a little bit of CSS. If you're tired of boring checkboxes and radio buttons, or you simply want a more consistent look of these controls across browsers and controls check out FontAwesome to provide you with customizable checks and boxes to use for selection boxes. In this post I'll show how to use pure CSS to set up FontAwesome checkboxes and radios and talk about a few gotchas I ran into along the way.

Read more...

Back to Basics: UTC and TimeZones in .NET Web Apps



Storing dates in persistent storage using UTC dates is a widely accepted best practice. But it's surprisingly complex using date data effectively if you want to let the user see dates and query data in their local time zone. Looking around I noticed that there's not a lot of comprehensive info on this topic, so I decided to take notes and write down some of the approaches I've used in this post. This post combines and overview and a number of helper routines specifically geared towards user timezone adjustments in typical ASP.NET Web applications.

Read more...

Adding non-NuGet references to the new vNext Projects



vNext projects depend on NuGet packages to reference external dependencies. But vNext projects also support 'classic' .NET targets and the Full CLR vNext both of which support and even require assembly references in order to access core .NET functionality. In this short post I describe how you can reference external assemblies in non-vNext and FullClr vNext targets in vNext projects.

Read more...

Azure VM Blues: Fighting a losing Performance Battle



I've been struggling with performance when putting up an Azure virtual machine with the eventual intend to replace my physical server. In this post I describe some of the performance issues I've run into with Azure Virtual Machines in a simple scenario of migrating a single Web site to a full VM setup.

Read more...

Blend Path interfering with C# Project Builds



Ran into a nasty Visual Studio error today that caused a compiler error related to an errand assembly reference from Visual Studio Blend. Blend? I don't even use Blend, and this is a Web Project. Here's what the problem is and how to get around it with a temporary hack.

Read more...

<main> HTML5 Tag not working in Internet Explorer 9/10/11



Ran into a problem the other day with Internet Explorer 11 not rendering the HTML5
tag properly - or rather rendering as if it wasn't there at all. Here's the problem and the simple workaround.

Read more...

Tip: Create a Visual Studio Menu option to Open a Command Window



I'm finding myself using the command line more and more, especially with ASP.NET vNext for running Web apps from the command line, accessing git and JavaScript build tools. Here's a real easy way to pop open a Command Window in the active project directory from Visual Studio.

Read more...

Using Cordova and Visual Studio to build iOS Mobile Apps



Apache Cordova is a hybrid mobile toolset to build Mobile applications using Web Technologies like HTML5, CSS and JavaScript. Microsoft recently released a preview of its toolset for building Cordova applications with Visual Studio. In this article Rick takes a look at the Visual Studio Tools for Apache Cordova for building, debugging and running iOS mobile applications from Windows by way of an example that takes an existing mobile Web AlbumViewer app and porting it to Cordova.

Read more...

INSTALL_FAILED_VERSION_DOWNGRADE: Watch your Android App Version



Ran into a nasty problem with an Android app install today and was unable to get the app to install on the device for debugging. Got an INSTALL_FAILED_VERSION_DOWNGRADE after a bunch of false starts it turns out this problem had an easy solution for me.

Read more...

Gotcha: Entity Framework gets slow in long Iteration Loops



I've been running into a common issue with Entity Framework where using a dbContext through many context operations can drastically slow down Entity Framework performance. Here's a quick overview of the problem and how to work around it with a few minor tweaks.

Read more...

Mixing $http Promises and $q Promises for cached Data



When creating services it's often useful to return data from the $http service, or cached data that already exists. You can't however just return the cached data, but have to turn it into a promise so it matches the $http callback signature. Here's how to deal with this frequent scenario.

Read more...

Creating multi-target NuGet Packages with vNext



The ASP.NET vNext Platform makes it much easier to create multi-targeted NuGet packages, through support of multiple build targets from a single project and the ability to compile project output directly to a NuGet package.

Read more...

Updating Assembly Redirects with NuGet



There's little known NuGet command that allows you to re-create assembly redirects for all NuGet packages in your project or an entire solution.

Read more...

WebClient and GetWebResponse not firing on Async Requests



Ran into an unexpected behavior when implementing an async version of WebClient to download data. While you can override WebClient to capture the HttpWebResponse object to capture additional Http information that is missing from the WebClient class, I initially had problems captureing the Respone on async requests. In this post I discuss a use case, problem and the simple solution.

Read more...

AngularJs and Promises with the $http Service



The AngularJs $http object returns custom promises which can be surprising when you try to work with them. You can use either .then() or the easier .success() and .error() methods - at the cost of some inconsistency in Promise usage as these extension are specific to the $http functions. In this post I review a few different ways you can use promises and more importantly what the various $http methods return.

Read more...

A jquery-watch Plug-in for watching CSS styles and Attributes



A few years back I wrote about a jquery-watch plugin I wrote that can monitor CSS property and Attribute changes and let you get notified if one of the monitored properties are changed. Unfortunately the plugin broke a while back as browser and jQuery dropped some older APIs. In this post I describe an update to the jquery-watch plugin using the newer and more widely supported MutationObserver API that brings high performance DOM node monitoring.

Read more...

Chrome DevTools Debugging Issues



I've run into a nasty Chrome bug that I can't resolve: My debugger is frequently not stopping on debugger commands or breakpoints set in the debugger.

Read more...

Capturing Performance Counter Data for a Process by Process Id



Process specific Performance Counters in .NET work directly only with Process Names, not Process Ids which can be problematic if you need to monitor performance of multiple instances of the same process. In this post I describe how you can capture multiple processes uniquely and monitor each individually.

Read more...

A .NET QueryString and Form Data Parser



.NET is a bit short when it comes to tools that can manipulate UrlEncoded data. If you need to read, create or modify raw querystrings or form data outside of ASP.NET's System.Web context there isn't a clean way to do this and even there if you want to modify url encoded data you'll need to write some code. This article describes a UrlEncodingParser class that lets you read in raw query strings, form data or entire URLs, then lets read, add and update values and then write the values back out. Makes you wonder why that functionality doesn't exist natively somewhere in .NET, eh? Code and samples are provided.

Read more...

The broken Promise of the Mobile Web



The Mobile Web has come a long way to provide the abillity to create rich UI and interactive, immersive and smooth Web based mobile applications. But there are still big gaps between mobile device features and what's available to Web developers when interacting with mobile devices. In this post I cover and contrast what's wrong with mobile Web development today and where I hope we are going, going forward.

Read more...

Using FiddlerCore to capture HTTP Requests with .NET



If you have an application that needs to capture HTTP or monitor HTTP traffic, FiddlerCore is the tool you can use to do it easily. In this post I demonstrate how easy it is to integrate FiddlerCore into an application to capture HTTP requests and save the data, as well as discuss how to deal with configuring FiddlerCore for SSL Certificate installation for HTTPS captures.

Read more...


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