Wednesday, March 07, 2007
« Orcas March CTP - Fixing the broken data... | Main | Incremental development helps Adobe redu... »
I'm going to document the things I run into as I transition from the May 2006 CTP of LINQ to the full March 2007 CTP of Orcas. Tonight after sorting out my data source issue I ran into a compile error with my Visual Basic code samples that are using XML Axis properties. The error is "XML Axis properties do not support late binding". Hopefully I'll be able to post back here shortly with an answer to why I'm getting this....

UPDATE:  Thanks to a comment from Avner I figured out that this is due to a regression in the capability of VB9 to infer types.  Previously things worked swimmingly with the following code:

    Dim rss = XElement.Load("rss.xml")
    Dim items = rss...<item>

With the March CTP the type of "rss" needs to be explicitly defined like so:

    Dim rss As XElement = XElement.Load("rss.xml")
    Dim items = rss...<item>

I like the old way better :)


 |  |  | 
Wednesday, March 07, 2007 10:43:58 PM (Eastern Standard Time, UTC-05:00)
Hi Steve - You are probably running into the limitation of type inference, where class or module variables are inferred to be objects (type inference doesn't work for these variables). Xml properties are not supported on Objects - they are only supported on LINQ to XML objects.

Regards,
Avner
Avner Aharoni
Thursday, March 08, 2007 2:03:47 AM (Eastern Standard Time, UTC-05:00)
Thanks Avner that helped. I'm not sure why the types couldn't be inferred in my case. Hopefully it's just an issue with my configuration and/or the CTP and not something that won't be supported in the future.
Thursday, March 15, 2007 11:06:03 PM (Eastern Daylight Time, UTC-04:00)
Hi Steve, I just want to reiterate that this is a limitation only when the variable is declared in the class/Module level. Its fine if its in a method/sub scope. Regards, Avner
Avner Aharoni
Thursday, March 15, 2007 11:12:22 PM (Eastern Daylight Time, UTC-04:00)
Hi Avner, The bit of code that was giving me trouble had the variable declared within a method. I'll have to take another look to see if I have/had something else out of whack.
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):