Converting web site projects from Visual Studio 2008 Beta 2 to Visual Studio 2008 RTM

The good news is that this conversion was a lot less painful than the move from the final beta of .Net 2.0 to it's released version. The only breaking changes I ran into were minor changes in LINQ to SQL. While I was converting web site projects, I imagine since my breaking changes were limited to LINQ to SQL, that these changes would hold true for other projects as well.

First, this is just one scenario, your personal experience may vary.

LINQ to SQL Designer and the DBML File Encoding

This change is self correcting for the most part. If you attempt to open a .dbml file or compile your app before making this change you will get a "Cannot load ..." error. When you click the "Ok" button, the dbml file will automatically be opened with the xml editor. All you need to do is click save, wait for the pause as it regenerates the classes, and then close the file. The error has to do with the utf encoding of the xml file.

Web.config Assembly Reference Change for System.Data.DataSetExtensions

Open your web.config file and find and change the version number in this line from 2.0:

<add assembly="System.Data.DataSetExtensions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

to 3.5:

<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

then save and close.

LINQ to SQL Add and Remove Method Name Changes

From here you can attempt to compile to find the remaining changes you need to make. The first ones you'll run into are the Add and Remove methods of the LINQ to SQL Table<> objects. The Add method was changed to InsertOnSubmit and the Remove method was changed to DeleteOnSubmit. While more wordy, the change was made to make them more explicitly describe their behavior.

LINQ to SQL OnValidate Partial Method Change

If you were using the OnValidate partial method, then you'll need to make a small change. But this time you may want to make some alterations to your code logic as well.

To put it simply, the OnValidate now has a ChangeAction parameter. This is a great change as it basically informs the method about the reason for the call. ChangeAction has four values: Insert, Update, Delete and None.

So, find and change all your:

partial void OnValidate()

to:

partial void OnValidate(ChangeAction action)

Depending on what your doing you may want to consider wrapping the contents of your method in a simple:

if (action == ChangeAction.Insert || action == ChangeAction.Update)
{
...
}

You may want to skip that for now and revisit it when you are ready to think through the implications of this change.

Conclusion

My test applications made use of extension methods, nested master pages and a few other 3.5 features, but so far I haven't run into any other breaking changes. If I run across more, I'll update this blog post.

Published Wednesday, November 21, 2007 9:44 AM by bschooley
Filed under: ,

Comments

# re: Converting web site projects from Visual Studio 2008 Beta 2 to Visual Studio 2008 RTM

Wednesday, November 21, 2007 4:01 PM by Rocky Moore

Thanks for the tips!  In the process of doing a few sites.  Sure wish they would have left the Add and Remove alone, it seemed less "database"ish and more "collection"ish with Add and Remove.  Oh well..  On to the trenches!

# Updating VS 2008 B2 Websites to RTM

Wednesday, November 21, 2007 4:12 PM by TheCoder

Updating VS 2008 B2 Websites to RTM

# re: Converting web site projects from Visual Studio 2008 Beta 2 to Visual Studio 2008 RTM

Wednesday, November 21, 2007 5:23 PM by Rocky Moore

One other possible issue I have ran into is the ListView change.  I found info on it at:

www.danielmoth.com/.../item-placeholder-must-be-specified-on.html

# re: Converting web site projects from Visual Studio 2008 Beta 2 to Visual Studio 2008 RTM

Friday, November 23, 2007 5:31 AM by Peter Kassenaar

Thanks for sharing! Very valuable stuff.

# re: Converting web site projects from Visual Studio 2008 Beta 2 to Visual Studio 2008 RTM

Tuesday, November 27, 2007 3:42 PM by Kevin Fitzgerald

Managed to get through all the changes, still have to wonder about the name change from Add to InsertOnSubmit. More wordy yes but explicit, in that case I would expect to see Insert (without submit)?

I liked the way (since the May 2006 CTP) that I got a collection (ok then an EntitySet) from the designer. Made a lot of sense to Add and Remove from that collection, but the InsertOnSubmit kinda ruins is for me...

Bah humbug!

Kev

# VS 2008 Beta 2 to RTM &laquo; Tales from a Trading Desk

Tuesday, November 27, 2007 7:16 PM by VS 2008 Beta 2 to RTM « Tales from a Trading Desk

Pingback from  VS 2008 Beta 2 to RTM &laquo; Tales from a Trading Desk

# re: Converting web site projects from Visual Studio 2008 Beta 2 to Visual Studio 2008 RTM

Thursday, November 29, 2007 8:43 AM by Miguel Domingos

I also ran into another issue:

Change the linq mtehod "ModifiedEntities" to "Inserts"

Leave a Comment

(required) 
(required) 
(optional)
(required)