Tuesday, September 23, 2008

Converting a WebSite project to a Web Application project

.. an interesting journey

In the last few weeks we have been preparing a conversion from a WebSite project to a Web Application project in Visual Studio 2005 solution. To complicate things a bit there is also SharePoint in the equation.

The reason to do the conversion was that we could not automate the build process in TFS and subsequently could not automate the deployment. Also the building of the solution itself within Visual Studio was handwork and took about forever.

What did we do?

Well, quite a lot was done to do the conversion. Along the process we were wishing louder and louder that someone had used his brain before picking the WebSite project. We had about 180 User Controls and about the same number of WebParts, that used these user controls. I know, what you want to say, probably not the best architectual design decision. But then again, when you do not take the time to think about the architectual design no one can put the blame on you for making the wrong architectual design . Duh.

We needed to do a two fold conversion: once for the User Controls and once for the WebParts.

TOKYO - AUGUST 06:  Surveillance humanoid robo...Image by Getty Images via Daylife
Converting the User Controls

We created a new Web Application project, deleted the Default.aspx and the Web.Config files and then copied all user controls from the WebSite project. Then we did a Convert to Web Application action through the context menu in the Source Explorer. This adds a.o. the designer files.

Using a specially written tool we processed all ascx and ascx.cs files to add namespaces, change and delete some of the attributes on the <%@ Control %> node. And we added a <%@ Assembly %> node.

Converting the WebParts

In the WebParts the UserControls were instatiated in the CreateChildPanel() method by calling the constructor. That needed to be replaced by a Page.LoadControl() command. Another tool was created to do that conversion.

Bumps in the road

We first figured the process out by creating a small and simple Proof Of Concept. That worked like a breeze. Then we started on a copy of the real code. Yep, that's when the manure hit the propellor. We came across multiple problems, mostly because of inconsistencies in the coding. Sometimes there were comments when did not expect them or a code file was not placed in the correct folder. So, some of our assumptions failed and we had some manual clean up after our conversion tools. But that was limited to roughly 20 files. Not too bad.

But we also saw that our Proof Of Concept was many times less complicated than our real world code. That kept us busy with debugging for quite a few days. That and the fact that we were not experienced SharePoint deployers did nt help speed things up.

Ready to roll

Last friday we were ready to roll. We had figured everything out and had fixes for all the small problems that we encountered. So, the monday was set as the big conversion day. We mailed our offshore team in India to stop any work on the code around noon and made a branch in TFS.

The Big Bang conversion

With the script in hand we took the steps one at the time and started the conversion at half past one. Ticking off each step we were ready to try and compile about an hour later. More manure hitting the fan. Some caused by missing references and some by the new code that was created by our friends in India. They did coding while we were testing out the conversion so we were now working with a new code base. So afcing some new interesting bumps.

We only had to do some things a second time, having forgotten to update one of our conversion tools. Gradually we saw the number of build errors go down from 300 and then up a bit again. And finally at half past seven we had a fully building situation we then checked in in TFS.

Today

Today, we hear some enthousiastic noise from fellow developers who find that the solution compiles a lot easier, without any manual building of separate projects and above all a lot faster than before.

Also we are now starting testing the deployment and ironing out any last bugs that are in there.

Lessons learned

The most important lessons learned is that especially in bigger application development projects it is absolutely necessary to think before you do, design before you start building as that will save you loads of time and trouble later on.

Further we have learned a lot about conversion and file manipulation through RegEx and changing files loaded into MemoryStreams which was an interesting excercise as well.

Reblog this post [with Zemanta]

Tuesday, September 16, 2008

Getting more hits through a banana

.. and maybe more bananas as well

In recent times I have published about the banana button and its use and also many competely useless posts about bananas. This being a more serious blog (ahum) there must be something about these banan posts. Well, I could try to pull together an interesting study about my GREAT PLAN that can take over the Internet as we know it, but no, no such plan exists. Yet.

There is just something about bananas that has always apeeled to me. I like to eat them, they're tasty and nutritiuous. But they are also connected with a smile: the curve looks like a smile when held up the right way. Bananas also have slapstick component through the eternal slipping on the peel. Top it off with the bright yellow skin and it is just a very attractive piece of fruit.

Why then yet another banana post?

Does the web need yet another piece of nonsense about bananas?

No.

Banana fruit, leaf and vegetableImage by Technofreak via Flickr
Why then continue?

I have seen many visitors ome to this blog from very weird searches in Google and sometimes they seem totally unrelated to the blog and the content. They are however not totally unrelated. As an example, I keep getting traffic from image search for "Pippi Longstocking". I had mentioned her in a post or two along with a picture I had taken in Sweden.

Ann Elk in Sweden

The second post even increased the traffic more.

a perfect dice throw
So. let's change that banana

It's a bit disturbing to get traffic to your blog like that, but on the other hand if you want traffic above anything else it is a way to do just that. In comes the banana! To the rescue comes the banana. For the people: the everlasting banana.

Bananas are healthy

It's just another stupid experiment to continu writing about all aspects of the banana to tray and make this post become one of the banana resources one would find high in serach reslts.

Bananas beat Google

As I have mentioned before apart from bananas bullets are important too.

A quick recap:

  • Bananas are tasty
  • Bananas are nutritious
  • Bananas are fun
  • Bananas are slastick
  • Bananas are superior
  • Bananas are traffic magnets
  • Bananas are Bananas!

Let's go Bananas!

Reblog this post [with Zemanta]

Friday, September 05, 2008

Five years ago

.. I ran in the dark in Oregon

This morning while scanning my news feeds I cam across this post from the Official Google Blog. It's about running the Hood to Coast run.

I just had to smile. I did that ficve years ago and I really, really like it. Today, by coincidence I am wearing my Hood to Coast tee from five years ago.

Start the day with a smile

The post made me think back of the team I was thrown in at the last moment, being the third reserve. It turned out to be a great adventure and a lot of fun. Met some great people and did some great running in a great part of the world.

Eventhough a small misunderstanding in communication eventually led to a conflict with a chaotic team lead more than a year later, it's a memory I cherish.

I wish I could do it again.

Tuesday, September 02, 2008

Google OS is a browser

.. well, well, well

Today, the world was shook up by Google in almost Apple style. There was a leak a day or maybe hours earlier than it would officially be announced. Or was it on puropse? Anyhow, the blog hive was alive with buzz-buzz-buzz. Google Chrome was announced.

There has been persistent rumors about the secret Google Operating System and any self respecting Google watcher was certain that one day that would become official. And today it has, sort of.

Well, maybe not. The OS is not an OS, it's a browser. A completely new browser. Designed by today's standards and today's demands. Not building on parts of the past.

Google's Hardest Smack Across Microsoft's Face...Image by l0ckergn0me via Flickr
Well a pleasant shock

This is a pleasant shock and I am really looking forward to this and how this browser will behave on my various sites I built. Will they still render as intended. I think so, since the browser uses the WebKit rendering engine.

Much greater is the anticipation about what the general public will think of it. Will they adopt it now there is browser with a really big name out there. There is big reputation at stake here. And will it nibble away more share from Google or will Firefox lose share? Will it become another tech toy for nerds and proffesionals?

Uhm and then this

Also today I came across this article explaining how IE8 behaves on a Windows system. How much memory it grabs and how much processor power it needs. Astonishing! Compare that with the story of Google Chrome and you can only shake your head.

Watching the official announcement

Doing some live blogging ;-)

  • It surely does look sexy.
  • The Omni Box seems more versatile than the Smart Bar, good name.
  • Web application becoming very much like desktop applications
  • There is a Porno Switch as well!
  • Crashing a browser will only crash tab, that's cool. I have seen and still see crashes of Firefox and IE and those ARE annoying!
  • WebKit is blistering fast!
  • Who wouldn't want a V8 under the hood? And what about a V8 running your JavaScript?
  • Built on Danish Virtual Machine expertise. Hidden classes, hmm, interesting.
  • Ha! I am already downloading!
  • Downloading and installing takes less than two minutes to get started as well! Again blistering fast!
  • 20:58 local time I am now editing this blog post in Google Chrome! I might be one of the first in the World!!!
  • LOL ".. based on my extensive testing for the last three minutes"
  • LOL Statistics for nerds
  • I am really impressed, but will still hold on to Firefox for the time being, but also will be using Google Chrome!

So, I had a quick look at one the statistics that run on my site to see what the Chrome browser is identfied as and .. Lo and behold! It's being recognized as Safari 1.3! This will no doubt be fixed pretty soon. But there is also a mention of Chrome there.

Blog log
Safari 1.3 Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13

Fun!

Reblog this post [with Zemanta]