RSSCategory: .NET



An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode

Posted by Leave a Comment

You may sometimes receive the below error if adding a new library to an existing project. It is also a common error when running older applications originally built for IIS 6 on newer versions of IIS.

Error Summary
HTTP Error 500.22 – Internal Server Error
An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.

Luckily there are a couple of easy solutions to fixing this error:
Continue Reading



LINQ – SQL Wildcard Equivalents

Posted by Leave a Comment

LINQ has several ways to mimic SQL wildcards in both query and method syntax. Below are a few examples of each:

Continue Reading



LINQ Single vs SingleOrDefault vs First vs FirstOrDefault

Posted by 39 Comments

Many people get confused about the difference between Single, SingleOrDefault, First, and FirstOrDefault methods in Linq. Below is a chart explaining the difference between them and examples of each scenario.

Continue Reading



LINQ Select vs SelectMany

Posted by 7 Comments

The best way to explain the difference between Select and SelectMany in Linq is to show an example. In this example we will return a list of courses, each containing a list of students. You will see that Select will return a list of lists of students while SelectMany will flatten the lists into a single list of students.

Continue Reading



Escaping Razor View @ Symbol in MVC project

Posted by 1 Comment

To escape the Razor View’s @ symbol in an MVC project you can either use double @ signs:


Or you can use Html.Raw to display the symbol:




Connecting VS 2008 to TFS 2010

Posted by Leave a Comment

Visual Studio 2008 does not work with Team Foundation Server 2010 out of the box. Setting it up requires a few steps, here is what worked for me:

Assuming you already have VS2008 installed.

1) Install SP1 (optional, but may already be done):

2) Install Visual Studio 2008 Team Explorer:
Continue Reading



Missing System.Web.Optimization in MVC4

Posted by 5 Comments

Opening up a MVC4 project in Visual Studio 2010 can sometimes result in a missing System.Web.Optimization errors. You can install the missing packages by using the Package Manager Console from the Tools -> Library Package Manager menu as shown below.

Continue Reading