Future blogs on Visual Basic can be found on the official .NET blog going forward.
Visual Basic Blog
A group blog from members of the VB team
Latest posts
Removing duplicate namespaces in XML Literals (Shyam Namboodiripad)
A common problem that one often runs into with XML literals and the LINQ to XML API is duplicate XML namespaces. Consider the following example. The code imports a default XML namespace - “hello”.Code: Imports <xmlns="hello"> Module Module1 Sub Main() Dim x = <A> <%= <B></B> %> </A> &n...
VB XML Cookbook, Recipe 7: Enumerating Large XML Files (Doug Rothaus)
VB XML Cookbook, Recipe 7: Enumerating Large XML Files (Doug Rothaus)It’s been a while since I wrote one of these XML cookbook entries. Here’s some info on a common problem: Really big XML files.I’m going to show you two things in this recipe. The first is a tip on reading very large XML files while still being able to use XML Axis Properties. The second is how to do make it available to LINQ queries by exposing it as IEnumerable.Reading a Large XML FileIf you’re new to working with XML, there’s something important that you need to know. That is, when you load an XML file into an in-...
Using HTML entities in XML Literals (Avner Aharoni)
One of the common use-cases of XML literals is creating HTML. However, HTML entities cannot be used in XML literals since LINQ to XML directly supports only the Data type definitions (DTD) defined in the XML 1.0 spec. You can read more about it here. The workaround is to use the Unicode representation of the entity, although it’s not as readable as the HTML entities, the output is the same. Here are two examples of HTML entities from the XHTML spec : And here is a small test program to show you can substitute the HTML entity with the Unicode representation: The output looks like this:
Channel 9 Interview: Array and Collection Initializers in Visual Basic 2010 (Beth Massi, Spotty Bowles)
I’ve written about collection initializers on my blog before, but I thought I’d catch up with the VB Team to tell me more about how they really work.In this interview Spotty Bowles, a tester on the VB Compiler team, shows us a couple of new language features: Array and Collection Initializers. He gives us insight into how they are implemented in the compiler and best practices on how to use them in our code. Additionally, he discusses how to extend Collection Initializers with your own extension methods. Channel 9 Interview: Array and Collection Initializers in Visual Basic 2010For more new Visual Bas...
Visual Basic 2010 is here!
It was a very exciting time this week, with the launch of Visual Studio 2010 and .NET 4. On April 12th, 5 launch events took place around the world in Beijing, Kuala Lumpur, Bangalore, London and Las Vegas. The video from Bob Muglia’s VS 2010 Launch keynote is now available on-demand. The agenda for day was VS 2010 sessions, including Windows Development, SharePoint and Office, Dev & Test Collaboration, and Project Management. Follow the “Visual Studio 2010 Launch” tag on Channel9 for more… There are also a number of session recordings available now on The Code Project. Tim, Alexandra, and I recorded a li...
Back to the future! – New version of the VB6 InteropForms toolkit is released!!
Along with all the new goodies that we released yesterday as part of Visual Studio 2010, one additional thing we did yesterday as well is release an update to the popular interopforms toolkit. This update brings VS 2010 (and VS 2008!) support to the toolkit and fixes a smattering of reported bugs. As many of you are aware, VB6 applications are alive and well in the community and this toolkit has proven to be quite successful in helping developers evolve these apps with .net functionality. It works by allowing developers to create ActiveX controls in .net that can be...
Crystal Reports for Visual Studio 2010
Crystal Reports has been a part of Visual Basic since 1993, and a part of Visual Studio since its first release in 2002. Crystal Reports has been a very successful component of these products. With the release of Visual Studio 2010, SAP and Microsoft have mutually decided to change how we deliver this important component to the .NET developer community going forward. Starting on Friday, April 16th, the beta version of Crystal Reports for Visual Studio 2010 will be available as a separate download from this site. Just like when Crystal Reports was integrated into the Visual Studio installation,...
Editing XML Literals Embedded Expressions in Visual Basic 2010 (Avner Aharoni)
The implicit line continuation feature in Visual Basic 2010 provided an opportunity to improve the code editing experience in XML literals embedded expressions. In Visual Studio 2008, pressing Enter inside an embedded expression would result in the cursor being positioned to the left of the end embedded expression tag. In Visual Studio 2010, pressing Enter inserts a newline for the cursor, and the end embedded expression tag moves to the line below. This minimizes the number of key strokes needed to nicely format an embedded expression. Example 1: Pressing Enter in an empty embedded expression 1) Starting poin...
On The Blink (Matt Gertz)
One of the really fun things about being associated with the Visual Basic team is getting to see all of the varied usages to which our customers put it. From enterprise software to games, our customer base covers a wide range. The most fun to see, however, are the hobby applications, because the writers of that code come up with some pretty off-the-wall (but very cool) uses for it.Case in point: I was contacted two weeks ago by a gentleman named David Swoboda (name used with permission), who was working on a magic trick that required him to blink the LED on an old iPac smart device. He&rsq...