If only I were

Building Great Software

Posts Tagged ‘.Net 3.5

.NET 3.5 SP1 Upgrades

leave a comment »

I’ve finished all of my upgrades to .NET 3.5 SP1 with no significant glitches or broken code. The upgrade included 3 Vista development machines and 1 test server (Server 2003). One Vista machine was 64 bit and the other two were 32 bit.

I realize that the Visual Studio 2008 SP1 installer will install .NET 3.5 SP1 as well, but I still went the route of installing the .NET service pack and then installing the Visual Studio service pack.

One of the Vista installs did give an error at the end of the install, but after rebooting, it had installed correctly. If you are patching your servers, be fully aware that you’ll need to reboot at the end, so don’t expect to get away with a live patch without taking down your server.

A friend of mine, Laurent Duveau, posted some simple instructions on performing a successful install. Make sure to do step #1 from his post if you have previously installed beta versions of .NET 3.5 SP1.

Written by Chris Sutton

August 16, 2008 at 1:47 pm

Posted in Technology

Tagged with , , ,

Alt.Net – Friday Afternoon

leave a comment »

I made it to Seattle around noon and had lunch with Roy Osherove, Adam Tybor, Sergio, Ian Cooper and Tim.  We had some interesting conversations from mocking to mobile phones (until Roy said he was tired of that talk) to firing practices in the UK.

It was good to put some faces to blogs I have been reading for a quite awhile.

Written by Chris Sutton

April 18, 2008 at 4:44 pm

Twin Cities Code Camp MVC Session

with one comment

Thanks to everyone who attended my ASP.Net MVC session. I hope you enjoyed it and I hope you get the opportunity to try out what the MVC framework has to offer. The slides have a lot more information than what I was able to get through in my talk. The project is still very young, but has so much potential.

Please leave comments here and let me know what you thought of the session. I’m trying to constantly improve it to make it the right fit.

More ASP.Net MVC Slides.

Written by Chris Sutton

April 8, 2008 at 11:41 am

Twin Cities Code Camp IV

with 3 comments

Yesterday, I was in the Cities at the fourth Twin Cities Code Camp.  It really was a fantastic experience, likely the the best one yet (I presented at the first two code camps as well). From the presentations I attended I would say that the quality of the presentations was very high. They easily would rival what you get at a paid conference. I also met a bunch of people I had never seen in person which is really cool.

Some of the Iowa crowd that went up was Javier Lozano, Bryan Sampica and Greg Wilson. There were several other attendees from Bryan’s company as well. The Iowa presenters and attendees have grown significantly since the first one where I was the sole Iowan as far as I know.

Some interesting people I met/saw were D’Arcy Lussier, Neil Iverson (Inetium), Brandy Favilla (New Horizons), Robert Boedigheimer, Chris Williams (Magenic), Aaron Erickson (Magenic), Kent Tegels (DevelopMentor), Jeff Ferguson, Chris Johnson, Saviz Artang, John Thurow, Kirstin (Magenic), Nicole and Kristen (New Horizons) and Justin Chase.

My favorite session was Neil Iverson’s PowerShell for Developers.  It was a fast paced live demo that kept incrementally building.  Rarely have I been so engaged in a session. D’Arcy’s MVC vs ASP.Net talk was also really interesting.  We only had about 6 people in the session, so we went around the room and said where we were coming from in our ASP.Net development experience. Then D’Arcy showed us how he typically structures his webforms applications, and we peppered him with questions.  I learned a lot from the session.

My talk was the second of the day in the large seminar room so we actually had about 50 people in the session.  One thing that was cool was that D’Arcy Lussier did an intro talk right before mine, so I got to build off of what he did in the session before. Mine seemed to go pretty well. There were a lot of questions and interest in what MVC brings to web development in the Microsoft space.

Jason Bock did a great job again bringing this all together.  It’s a lot of work coordinating an event like this.

If you liked what you got at the Twin Cities Code Camp you’ll definitely want to check out the Iowa Code Camp.  We’ll be a little bit smaller, but have some top notch presenters, a great facility and will have great prizes as well.  The registration is right on the home page and is as simple as it gets.

Written by Chris Sutton

April 6, 2008 at 9:27 pm

ReSharper 4 EAP – 764

leave a comment »

I just downloaded and installed nightly build 764 of ReSharper 4. I usually don’t go this bleeding edge, but I’m feeling a little dangerous.

Most people I’ve read say that these builds are pretty stable by now. I’ll post with an update by the end of the week.

Written by Chris Sutton

March 29, 2008 at 7:44 pm

A well-used string extension method

leave a comment »

James-Newton King posted an interesting extension method called FormatWith() that you can call from any string literal or variable.

There are two useful aspects to this function.  1) You can format a string inline instead of wrapping your string with String.Format():

string Name = “Chris”;

“My name is {0}”.FormatWith(Name);

In my opinion, the less you have to nest items – String.Format(“…{0}”) – the easier it will be to read. Chaining items together could be abused, but over all it is simpler for the reader and writer.

2) It allows for named placeholders like this:

Person aPerson = new Person();

aPerson.FirstName = “Chris”;

aPerson.LastName = “Sutton”;

“My full name is {FirstName} {LastName}”.FormatWith(aPerson);

Check out James’ post to see his implementation, its surprisingly simple.

Much of what C# 3.0 brought us was simplified syntax and the potential for code that is easier to read and write (more fluent). This use of extension methods is more natural and expressive and will certainly make my coding cleaner.

Written by Chris Sutton

March 28, 2008 at 8:58 am

Posted in Technology

Tagged with , , ,

Cedar Rapids 2008 Launch Event

leave a comment »

This Monday, March 17th, is our CRIneta.org Visual Studio/SQL Server 2008 Launch Event.  If you want to learn about the new products and you want to have a great time and win from a huge pool of excellent prizes, then go to CRIneta.org and RSVP to be a part of this event.

Tim Barcz, Greg Sohl, Arian Kulp and I are presenting sessions on Visual Studio enhancements, Linq, IIS 7, C# 3, the new .Net Framework features and the new SQL data types.

We have room for 50 people and 38 are RSVP’d already, so don’t wait too long. We are doing the Launch at the Marriott on Collins road in Cedar Rapids. Check the website for more details.

Written by Chris Sutton

March 13, 2008 at 9:18 pm

Iowa Code Camp – Spring 2008

leave a comment »

We are planning our first ever Iowa Code Camp.  It’s going to happen at the University of Iowa’s Conference Center in Iowa City on Saturday May 3rd.

The details are coming together nicely and we already have about 1/2 of our speakers in place.

Our current sponsors are:

  • University of Iowa
  • Microsoft
  • And several others are in the works

We are currently looking for more sponsors to provide some good food, drinks and prizes.

If you are interested in helping in any way, leave me a comment and I’ll make sure to pass your information on to the right person.

Javier has already posted the Code Camp on bostondotnet.org

Clarity with var in C# 3

I was in a class the other day and the instructor introduced the var keyword and then showed us some of the standard fare examples of how to use it.  Then the discussion turned to when to appropriately use var.

An obvious place to use var is when you do a LINQ query and you are selecting a limited set of columns back from the original type:

NorthwindDataContext north = new NorthwindDataContext();
var emps = from e in north.Employees
           where e.City == "London"
           select new { e.FirstName, e.LastName };

There isn’t much choice here since emps is an anonymous type made up of the employee’s FirstName and LastName. The custom or partial projection (everything after the select keyword) forces the result to be an anonymous type.

Then the suggestion came up that you should only use var when you don’t know the type. Here is where I differ in opinion and usage. Look at the following snippet:

using System.ServiceProcess;
.
.
.
var procs = from p in ServiceController.GetServices()
                where p.Status == ServiceControllerStatus.Running
                select p;
procs.ToList().ForEach(p=> Console.WriteLine(p.ServiceName));

procs is certainly IEnumerable<ServiceController> but it doesn’t matter to me. I primarily care that procs is a list and that the individual items in the list have a Property called ServiceName. The underlying type is important to the compiler, but the people that have to read code aren’t compilers right?

I’m very glad that the compiler and runtime do what they do with types, but I want the reader’s focus on the simple LINQ query and iterating over the list it to get a property, not on the type. Replacing var with IEnumerable<ServiceController> is harder to read and less useful.

I think carefully picking your focus can improve your code’s clarity.

Update 5/24/2008: Dare Obasanjo has written one of the best posts expressing caution about abusing var. If var genuinely makes it harder to read your code then you should consider replacing it with an actual type.

Written by Chris Sutton

December 13, 2007 at 10:36 am

Posted in Technology

Tagged with , , ,

ASP.Net MVC Quickstart

with 3 comments

The MVC Toolkit has finally been released as a CTP. Go here to start out – this is the official page with all the links and info you need. Here is the official quickstart link.

kick it on DotNetKicks.com

Update: 1/17/2008

Jeffery Palermo has a great list of his links to get you started.

Links for ASP.Net MVC Reading:

Scott Guthrie is the grandmaster of this project and has posted extensively on different aspects of the MVC framework. Here are some quick links to get you going.

Original post about ASP.Net MVC: http://weblogs.asp.net/scottgu/archive/2007/10/14/asp-net-mvc-framework.aspx

MVC Part 1: http://weblogs.asp.net/scottgu/archive/2007/11/13/asp-net-mvc-framework-part-1.aspx

MVC Part 2(URL Routing): http://weblogs.asp.net/scottgu/archive/2007/12/03/asp-net-mvc-framework-part-2-url-routing.aspx

MVC Part 3(Passing ViewData): http://weblogs.asp.net/scottgu/archive/2007/12/06/asp-net-mvc-framework-part-3-passing-viewdata-from-controllers-to-views.aspx

MVC Part 4(Form editing and posting): http://weblogs.asp.net/scottgu/archive/2007/12/09/asp-net-mvc-framework-part-4-handling-form-edit-and-post-scenarios.aspx

Jeffery Palermo of CodeBetter and Party with Palermo Fame has written some about the MVC bits as well. He has an mvccontrib project.  Read about the guidelines for participation.

Rob Conery talks about how to use use a RESTful architecture with ASP.Net MVC.

Nikhil Kothari has a great post showing how to build a basic app.

Links for Listening:

Polymorphic Podcast with Jeffery Palermo: http://polymorphicpodcast.com/shows/aspnetmvc/

If you want the best information on the ASP.Net MVC there are a couple of other people you should be paying attention to: Phil Haack and Fredrik Normén.

I will be updating this post with more information as I find it out.

Well I have some digging to do. I need to get the bits installed for some client work that will be using MVC early next year.

 

kick it on DotNetKicks.com

Written by Chris Sutton

December 9, 2007 at 9:39 pm

Posted in Uncategorized

Tagged with , , , , , , ,