News

How to Fix MSBuild Error MSB4006

Author: Craig Stuntz You may encounter an error which looks like this: MSB4006: There is a circular dependency in the target dependency graph involving target “ResolveProjectReferences” [MyProjectName\MyProjectName.csproj] …when running MSBuild from the command line. This error happens when: You run MSBuild on a machine with .NET 4.5 installed and You build a project…
Read more
News

Why Won't Visual Studio Step Into This Code?

Author: Craig Stuntz I helped another developer debug an interesting problem this morning. Let’s see if you can spot the problem. The code in question looked something like this simplified version containing only enough code to show the problem: public void…
News

In LINQ, Don't Use Count() When You Mean Any()

Author: Craig Stuntz If you have a list, array, or query in a C#/LINQ application and need to check and see if the list is empty, the correct way to do this is to use the Any() extension method: if (q.Any()) { Similarly, you can check to see if any elements in the list meet a certain condition: if (q.Any(i => i.IsSpecial)) { If the query provider is something like LINQ to Entities…
Read more
News

Using DayPilot with ASP.NET MVC

Author: Craig Stuntz I’m going to demonstrate how to use the open-source DayPilot Lite calendar control in an ASP.NET MVC application. I will discuss the capabilities of the control and consider the general problem of how to use controls designed for…
News

Using jqGrid with ASP.NET MVC: Deleting Records

Author: Craig Stuntz This is the fifth post in a series on using jqGrid with ASP.NET MVC. Today, we’re going to begin examining the grid’s editing features by implementing deletes. If you’re new to the series, you might want to start at the beginning. The delete feature of jqGrid is, oddly, almost entirely undocumented, even though there quite a few examples of different methods of…
Read more
News

Using jqGrid with ASP.NET MVC: LINQ Extensions

Author: Craig Stuntz Mere hours after I posted the first in a planned series of posts on using jqGrid in ASP.NET MVC applications, Phil Haack, a rather-more-widely-read-ASP.NET-MVC-blogger, wrote a long post on, er, exactly the same thing. Who, me, bitter? Naahhh… 🙂 But…
News

ASP.NET MVC TempData Is Really RedirectData

Author: Craig Stuntz Update: This post was written for MVC 1. TempData behaves completely differently in MVC 2 Beta and higher. In these versions, TempData is cleared only when it is read (or when the session expires). Many people seem to be confused about the TempData feature in ASP.NET MVC. TempData behaves like the ViewData dictionary, except that it persists until the next request from the…
Read more