Monday, 30 April 2007
LINQ: upgrading May CTP projects to Orcas Beta 1
here are a few of my main findings/hurdles encountered when upgrading May CTP web projects to Orcas beta 1 Web Application Projects. I'm targeting version 3.5 of the framework for deployment on a Server 2003 with .Net 2.0 runtime installed, i will update this article if it doesn't work out.
- if you had any code in the "App_Code" folder, VS will probably have set the compile action to "content", it should be changed to "compile". otherwise you will get errors like: The type or namespace name 'xyz' could not be found (are you missing a using directive or an assembly reference?)
- you'll have to remove any reference to the System.Query and System.Expressions, these are not part of the new LINQ spec.
- Replace System.Data.DLinq with System.Data.Linq.
- if you want to use any LINQ expressions, like "from x in db.Table select x" then you need to include the System.Linq namespace. otherwise you will get errors like 'System.Data.Linq.Table<xyz>' does not contain a definition for 'Where' and no extension method 'Where' accepting a first argument of type 'System.Data.Linq.Table<xyz>' could be found (are you missing a using directive or an assembly reference?)
- you will also need to include System.Linq.Expressions if you are using
"language-level code expressions to be represented as objects in the
form of expression trees".
The old LINQ assemblies are versioned 1.0.2319.19044 (May CTP) but the new ones for Beta 1 are versioned 22.214.171.124. Have a check through the referenced assemblies in your project to make sure you have the latest versions.
look out for the new crystal report assemblies, 10.5.3700.0. a web app referencing the new versions in web.config will complain if these versions are not available on the server. i'll update soon when i have found out how to do this.
Monday, 30 April 2007 11:50:28 (GMT Daylight Time, UTC+01:00) .Net General | Asp.Net