Contact   •   Products   •   Search

Rick Strahl's Web Log

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

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 WebSurge - an easy way to Load Test Web Applications



Recently I had a need for a load testing tool and after quite a bit of frustration to find a decent reasonably priced load testing tool, ended up giving up searching and building one instead. In this post I introduce West Wind WebSurge, an easy to use Web load testing tool that makes it easy to stress test Web applications.

Read more...

Project Navigation and File Nesting in ASP.NET MVC Projects



Project navigation in large projects can be a pain as you have to sift through large amounts of files. I found myself re-organizing projects in a few different ways to make project navigation easier. In this blog post I share a few different approaches as well as some useful tooling to improve my daily workflow.

Read more...

Nuget Dependencies and latest Versions



NuGet is a great component distribution mechanism and it's awesome for consuming components and getting them into projects. However, creating NuGet packages and getting the version dependencies worked out reliably has been a challenge. Specifically the way dependency versions are pulled in by NuGet are somewhat counterintuitive. In this post I look at some of the issues and bring up some thoughts of how this could work better.

Read more...

A dynamic RequireSsl Attribute for ASP.NET MVC



In ASP.NET MVC the RequireHttps attribute allows for securing controllers and controller methods, but it's limited to either on or off statically. In this post I discuss a custom attribute that can dynamically set SSL usage based on a configuration setting or delegate.

Read more...

AngularJs ng-cloak Problems on large Pages



Angular supports the ng-cloak directive to address hiding initially unrendered template content. I found out the hard way that sometimes with very large pages this mechanism doesn't quite work and still results in slight page flicker of the unrendered template content. In this post I describe the problem and several easy solutions to get around it the edge case scenario.

Read more...

Creating ASP.NET MVC Negotiated Content Results



ASP.NET MVC doesn't directly support content negotiation, but with a little bit of work it's very straight forward to implement a NegotiatedContent ActionResult that can switch its response type based on the Accept header.

Read more...

Filtering List Data with a jQuery-searchFilter Plugin



When dealing with HTML based list data, filtering that data based on search text is a nice UI feature that's very useful for quickly finding what you're looking for. In this post I show you how to can create this nice UI effect with a few lines of jQuery code, and then provide a jQuery plug-in that simplifies the process further.

Read more...

IIS SSL Certificate Renewal Pain



IIS SSL Certificate renewals always seem to be a pain. Rarely does it just go right and I never seem to remember whether I should renew, or just issue a new cert. The answer is the latter, but this post discusses some of the issues and how to avoid them when renewing or installing new SSL certificates.

Read more...

Westwind Application Configuration Updates



I've recently updated my code-first, class based application configuration library with a number of features and updates. This blog post discusses some of the changes and new features of this useful library.

Read more...

Updated ASP.NET Database Resource Provider



I've updated my database ASP.NET Resource Provider project into a more formal project with a new home page, and official GitHub repository for the source code as well as a getting started video. In this video I talk about what's new and a few examples on how to use the provider.

Read more...

Auto Selecting Cultures for Localization in ASP.NET



When creating multi-language Web sites, one of the key issues you need to deal with is how to assign a culture to display the appropriate resources. Whether you need to auto-switch locales based on browser language, or explicitly assign a locale based on user preferences there is generally some code logic involved in making these decisions. In this post I show what options are available and a small helper that simplifies setting the culture in ASP.NET applications.

Read more...

Using CSS Transitions to SlideUp and SlideDown



CSS Transitions are a nice way to replace jQuery animations with smoother counterparts. Some transitions however, like height and width transitions can be tricky to handle with pure CSS code due to container sizing issues. In this post I show how create create transitions to mimic most of jQuery's slideUp() and slideDown() functions using CSS and small jQuery plug-in.

Read more...

Forms Auth loginUrl not working after Windows Update?



Ran into a problem with Windows Update last week that seems to have broken forms authentication and the loginUrl attribute when set. Looks like new default settings are changing default behavior, and an extra configuration key is required to get the old default behavior back.

Read more...


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