RSSCategory: .NET

Sep

29

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

Apr

5

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

Apr

3

LINQ Single vs SingleOrDefault vs First vs FirstOrDefault

Posted by 36 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

Mar

22

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

Aug

15

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:

@Html.Raw("@")

Jun

21

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): http://www.microsoft.com/en-us/download/details.aspx?id=10986

2) Install Visual Studio 2008 Team Explorer: http://www.microsoft.com/en-us/download/details.aspx?id=16338
Continue Reading

Jun

15

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