Converting ASP.NET WSP (Web Site Projects) to WAP (Web Application Projects) with VS2012

image_thumb.png

  Background There are quite a few articles written on the differences between WSP’s and WAP’s.  In this article, I will not go into the details but just give you some clean mechanics necessary for converting pages using Visual Studio 2012.  Some of those articles are listed below. http://mitchelsellers.com/blogs/2008/01/02/wap-or-wsp-which-to-use-and-why.aspx http://vishaljoshi.blogspot.com/2009/08/web-application-project-vs-web-site.html http://aspnetresources.com/blog/web_site_vs_web_application_project_wap When I was new to Visual Studio, I did choose WSP projects because it seemed easier. Now that I’ve done quite a bit more with ASP.NET, I much prefer WAP projects.  Actually, I hate WSP projects … Continue Reading

Using LINQ ForEach To Populate Generic List in C# AND Enum to List

A C# trick I first had trouble wrapping my head around is using the LINQ ForEach operator to populate a list.  I was originally inspired by some source I found in the EXT.NET Icon building sample.   In addition to the ForEach lamda trick they included a very nice pattern for converting a c# Enum to a List.  So, let’s get right to the code.   enum Days { Sat = 1, Sun, Mon, Tue, Wed, Thu, Fri }; static void Main(string[] args) { List<string> daysOfWeekList = Enum.GetNames(typeof(Days)).ToList(); daysOfWeekList.ForEach(a => Console.WriteLine(a)); }   That’s it!   Just another two patterns of using c# which helps me live cleaner in c#! HTH’s. … Continue Reading

Entity Framework Code First From Microsoft, Best and Worst Practices

image.png

  Introduction I’ve been building a fairly sophisticated product that will need to sustain a high transaction rate using the shipping version of Microsoft’s Entity Framework CodeFirst (4.1) which is part of Visual Studio.  I keep meaning to blog my experiences because I’ve been learning a huge amount about how to use and how to abuse the product.  My general style for building database intensive apps is not to spend a lot of time on optimization while I’m implementing, but to then go back and fix bottlenecks.  Back in the old days (last year), I would pretty much write my own views and then reference the with LINQ2SQL which pretty much solved most of my performance issues.  The reason is because views … Continue Reading

With Visual Studio, Open Same File In Two Windows, Updates Reflected in Both

image.png

I’ve always been frustrated in Visual Studio (all versions I can remember including latest vs2012) with not being able to look at the top of a file and edit the bottom.  Recently, on an Microsoft insiders list I participate in, someone posted that exact feature as a suggestion for future versions of Visual Studio.  Before I had a chance to post back a “+1” some one else posted back that you’ve been able to do that for years in all the versions of Visual Studio he could remember. All you have to do is, with the version of the file you want to duplicate open (you are selected to that tab), press the menu choice “Window/New Window” and presto!  you have two copies.     Now, after pressing Window/New … Continue Reading

Follow

Get every new post delivered to your Inbox

Join other followers: