Archive for September, 2008

Frustrating IIS7 Configuration 500 Error

Posted in Programming on September 22nd, 2008 by Kyle – 2 Comments

Recently I have been putting a lot of my evenings and weekends in to a re-architecting of a site I host and develop for some friends of mine Pert’ Near Sandstone. The Entire site is built using ASP.Net and features a standard (web forms) website front end (public facing) and an admin side also built using web forms.  I liked this at the time, but it soon became very difficult to debug, maintain and add features to.

The biggest factor in deciding the re-architect the site at the time was the lack of interoperability in the Admin side/application.  It worked as intended about 60% of the time (60% of the time it works every time).  The web forms admin side required a lot of code that was spread out over numerous code behind files, making it difficult to maintain.  Not to mention similar logic was being duplicated, violating the DRY principal (don’t repeat yourself).

Around the same time I had just finished my exploration of the new ASP.Net MVC (model-view-controller) model and had fallen in love with web development all over again.  I had been in the process of creating some sample applications with it.  I even started testing how it deployed on various web hosting platforms.  I discovered that the MVC pattern DID work on IIS6 and IIS7.  The URL’s on IIS6 required special mapping (either adding .aspx or .mvc to map to the aspnet framework), I didn’t like that so I found a host that offered IIS7.  The URL’s are now clean and to my liking.  MVC makes sense, it creates clean separation of UI, business logic and data models. and will be an architecture of choice on ASP.Net.

So to make my long story short and to the point.  I ended up re-architecting the Admin (once web forms side) of my site/project into a new MVC project in my solution.  I started bringing over functionality one peice at a time, while reworking the underlying business logic and data access logic into various providers and repositories.  I had everything working perfectly for a phase one deployment to the web host.  I had 2 projects to deploy, one public facing site (web forms) and one admin MVC site.  I set up the web host to use a virtual directory for the the MVC site, configured my connection strings as:

    <connectionStrings>
    <!-- PRD -->
    <add name="PertNear.Data.Properties.Settings.PertNearSandstoneConnectionString"
connectionString="server=secureserver.net;uid=user;pwd=pass;database=db"
providerName="System.Data.SqlClient"/>
    <add name="PertNear.Membership"
connectionString="server=secureserver.net;uid=user;pwd=pass;database=db"
providerName="System.Data.SqlClient" />
 
    <!--
    <!--  DEV
    <add name="PertNear.Data.Properties.Settings.PertNearSandstoneConnectionString"
connectionString="Data Source=localhost;Initial Catalog=DB;Integrated Security=True"
providerName="System.Data.SqlClient" />
    <add name="PertNear.Membership"
connectionString="Data Source=localhost;Initial Catalog=DB;Integrated Security=True"
providerName="System.Data.SqlClient" />
    -->
    </connectionStrings>

I uploaded everything to the virtual directory and tried to access the new applications. The public facing side (web forms) worked cause it had a separate config file, the admin side through the generic IIS7 internal server error with no messages. I looked everywhere to find a solution. Many sources said to add a wrapping element around the parent web.config so that it’s settings don’t conflict with the virtual directories (inheritance in IIS7 config files). I spent a week plus on this issue until I ran the config file through an XML validator. As you can see I had a rouge comment tag in the config. Had I known that IIS7 was first validating my config file I might have gotten an error along the lines of “invalid xml” instead of generic 500 error.

Reader be warned, be sure the validate the web.config file before uploading. And check the config file before you make any drastic changes like I did (I moved the MVC project into the public facing site to now have just one project to deploy, thinking that might solve the issue). One point worth mentioning, I had edited my published web.config outside of VS2008 in a text editor, hopefully VS would have caught that error for me had I known.

Good luck, happy coding and avoid the frustration I had.

Where I was 7 years ago.

Posted in General on September 11th, 2008 by admin – Be the first to comment

This day, September 11th, will make any person think back to what they were doing when the tragic news broke from New York.

My experience was unique, to say the least. Seven years ago I was in my senior year of high school at Park Center Senior High in Brooklyn Park, MN.  I had stayed home that day because I had an orthodontist appointment in the morning. My mom was going to take me to the appointment and then drop me off at school before fourth period. I remember waking up, eating breakfast and then watching the television.  Just as we were about to leave, the news footage started coming on the TV about the first plane. They were reporting it as a small plane at first, not a jumbo jet.  Soon after my mom and I watched in disbelief as we saw the live footage of the second plane.

We were now running late for the appointment so we got in the car and drove to the dentist. The appointment was just a usual band replacement and tightening. I remember sitting in the chair wondering what was going on while I could hear the news over the radio (they usually have music on). The technicians where confused with what was going on, I recall telling them what I had seen at home. The appointment didn’t last long and we were on our way back home; don’t know why my mom didn’t take me to school. She probably thought that school might be closing and she should find out before she drops me off.

Once back, we flipped back on the TV to see replays of any recent events. Television shots from all angles and opinions were spewing everywhere. I remember seeing all the reports as they broke, from the initial crashes, pentagon crash, Pennsylvania crash, to even the collapse of the two towers. My mom and I were in shock, she was calling everyone she could think of including my dad and relatives who live on the east coast (everyone was safe). Once the second tower had collapsed it had gotten late and was time to get me to school.

When I got to school, all the TV’s in our lunchroom were tuned to the news channels and there were groups of students, faculty and staff watching in dis-belief. I headed up to my class and it was a different story, no one knew what had happened and slowing the information started trickling in. Later, in one of my economics classes the teacher carted in a TV for us to watch, knowing that trying to teach us was going to be useless.

The facts of that day are still unbelievable. Our security of a nation was not as secure as we expected. The rest is history better left unsaid by me. However In my opinion, and the opinion of many, the events of that day changed this century. We suspected Al Quida and Bin Laden for the attacks as a nation, but yet we went to war with Iraq??? I don’t see the connection between WMD’s and Boeing 767’s.

Science Rocks!

Posted in General on September 11th, 2008 by admin – Be the first to comment

I Found this on one of my friends posts and found it very interesting.  Science Rocks!!!

Black Betty Snowboard Video

Posted in Video on September 4th, 2008 by Kyle – 1 Comment

During college I was big in to video editing and movie making.  Since then priorities have changed to coding and life.  I was cleaning up a hard drive I used back then and found one of my favorite creations.  I’m sure I have one more video that I made/published, I just have to find it.  All of the filming and editing was done by me, and all of the riders featured are friends of mine.  Hope you enjoy!

http://www.vimeo.com/1615944

The Future of Computers

Posted in General on September 3rd, 2008 by admin – Be the first to comment

Just read this interesting article sent by my friendJustin about the future of computers.  This is pretty cool and worth the read if you like engineering or computers.

Link

Byte Sized Tour de France Stage 3 Winner

Posted in General on September 3rd, 2008 by admin – Be the first to comment

Maybe I can be a pro cyclist after all…  My wife and I have been following the Tour de France 2008 Stage 3 winner Samuel Dumoulin for a while.  We like to keep up with his achievements because he is similar in size to us.  We all (myself, wife and Samuel Dumoulin) all stand about 5′ 2″ (5 feet 2 inches) tall and for my wife and I seeing someone who is similar in stature win such a stage and event is enough to keep us motivated.  How cool would it be to meet him or even take a ride with him through France, Awesome!  Way to go Samuel!  Keep up the good riding.

Samuel Dumoulin on team Cofidis

Bytecyclist dot com

Posted in General on September 3rd, 2008 by admin – 1 Comment

Welcome to ByteCyclist.com.  My name is Kyle LeNeau, I am the author of this site, idea, name, code, plugins, and anything else.  I am a programmer from Minneapolis, MN who enjoys bytes (coding) and riding my bicycle thus the name bytecyclist.com.  I amThe ByteCyclist.  This site is formed with the intent of getting my thoughts out to the world.  Since I’m a developer  you should expect code samples and ideas of mine along with any projects I might be working on.  As a cyclist, who knows what will end up here, maybe some cool bike sites/links, rides of mine or anything else related to biking.  Enjoy the content.