Tale of Two Upgrades (RAD Studio 2007, VS2008)

Thursday, 13 September 2007 23:56 by salim

In my years of working with Delphi, I have had to upgrade existing code base to next version. The only version I did not do this for was 4-5. All of these upgrades introduced breaking changes with varying effort to resolve. So, I have been expecting some things to go wrong when we attempt the upgrade from Delphi 2006.net to 2007.net, especially since it involves a change in framework.

Usually I do not complain too much about these upgrade issues. Most of the time the changes are result of improvements of language and VCL and it is a price I was willing to pay - until yesterday.

This is the story of two upgrades that I tried during the last two days.

Visual Studio Orcas Beta 2.

On Sunday, I finally installed Visual Studio 2008 Beta 2. First I tried a small LINQ application which worked nicely. Then I went to read some documentation, which was very good for a beta 2. Next, I tried the new Client Management services and played with a few authentication options. While the documentation was a bit hard to find this time, once I found it, it was reasonably well written. After a few more poking around, I decided to check a good size project. So, I created a copy of a web project I am working on. This is based on DotnetNuke (more about this later). I have a couple of web application projects implementing my modules, a web service and a bunch of libraries. For data access I use NHibernate. I wanted to try LINQ for NHibernate the Alt.Net guys are cooking up. With a lot of skepticism I opened the solution. As expected, it notified me about upgrading the solution and started doing it. It did take a few minutes and it asked me whether to convert my ASP projects to framework 3.5. I said yes, it eventually finished conversion and opened the project. I pressed F5, it started compiling, started the ASPX development server, started my webservice, started my DotnetNuke web site and everything worked fine. I was really very pleasantly surprised. I can imagine the engineering effort that went into providing such a smooth experience. Achieving this in Beta 2 is even more commendable.

Codegear RAD Studio 2008 (Highlander) RTM

On Monday night I got the mail from CodeGear for RAD Studio 2007 trial. (I am still waiting for upgrade notification, which apparently is going to take two weeks). I downloaded and installed it. I do like web distribution and in my case, installation went without a hitch. It did take a long time to finalize the help file integration but I doubt if CodeGear had anything to do with that.

Once the installation is over, I started it up. I cannot comment on speed as this is the first time I was running Delphi in this laptop. Once it came up, I started looking around. Thought I will do the web application first. Created a simple application, pressed run. The firewall warning came up. Didn't think it was nice for a web application IDE. I was able to connect to the server from the browser without much effort. I was impressed by it. Well, I have always had good opinion about Intraweb.

One of the things I was expecting eagerly from Highlander was the MSBuild support.  So, once I finished playing with the IDE, I tried a commandline build of my test application. We had been using MSBuild commandline builds for both win32 and .net under D2006 first using a set of custom tasks and recently using the tasks from D2007 Win32. We used a set of non-IDE projects for driving this commandline builds as Delphi has this really annoying habit of adding absolute paths to the project files. The commandline worked fine once I found the Rad Studio Command prompt with the necessary path variables.

This was followed by a series of efforts at opening my existing project group file. The first trial failed because I did not make the files read/write. The IDE went through all the 44+ packages and told me that the edit buffer is read only. It was also occasionally tried to open forms with custom components and failing to load them. So, I refreshed my view, made everything read write and opened the group again. The message window notified me of resolving or failure to resolve assembly references. Since my assemblies are not built yet, they also failed to load.

Once the conversion was complete, I selected the first project and clicked on Build All From Hear. Immediately, the build failed saying c:\windows\system32\borland.vcl.dll was not found. I started changing every one of the references (including the ones the conversion log said was resolved) and compile the projects one by one. Soon I made some mistake and the projects got corrupted again. Once more refresh of the view, another conversion and yet another try at compiling. Same result. Then I decided to close the solution and reopen it. Voila. it correctly found the Borland assemblies, but I found that all the assemblies that IDE failed to find (because they were not built yet) was redirected to (can you believe it) Windows\system32. Why on earth a .Net IDE working under Vista would assume that I generate (or third parties will copy) assemblies into windows\system32????

That takes us to the next iteration. One more refresh, but this time I decided not to try converting the solution. Instead, I deleted all bdsproj and bdsgroup files from my view, and created a new solution. I, then added each dpk/dpr file to the group, compiling each of them before adding the next one. It worked for most part. But then came the annoying bugs, but that is for another time.

The compile was not clean either. There were a couple of breaking changes, noticeably unavailability of implicit conversion of TDateTime to double and THandle to integer. I am sure it is defined in one of those units, but ofcourse the documentation does not say anything. Actually the documentation on converting win32 projects have not been updated since Delphi 2005 it seems!!!

10 years ago, I wouldn't have considered using Visual Studio for my development. Now, I just want to stop using Delphi.

Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed
Comments are closed