Browse by Tags

All Tags » Orcas » DevCenter (RSS)
When working with VB9 you may get this cryptic error : XML namespace prefix 'xmlns' is not defined If you are using only default namespaces you can fix this by including a definition for the xmlns as an Import statement or as an xmlns attribute...
If you use XML literals in your code, adding one to another: Dim e1 = <a:books></a:books> dim e2 = <a:book></a:book> e1.Add(e2) You will have the xmlns declaration repeated in each of the elements, when really it is only needed...
11 comment(s)
Filed under: , , , , ,
In VB9, there's a bug when using XML literals with any type member that is a protected keyword. For example, given the following psuedo types, Class Doc Public Property [Imports]() As List( Of DocImports) End Class Class DocImports Public Property...
Just spotted it on MSDN subscriber downloads. Enjoy :)
2 comment(s)
Filed under: , , , ,
I've finally given the Snippet Editor a major make over including a new look. To go with this, I've given it a new home on my web site: http://billmccarthy.com/Projects/Snippet_Editor And I've added a Snippets category to this blog for feedback...
In playing with Windows.Forms in VS 2008, I got the same old error I use to get in VS 2005 sometimes: Type must be a type provided by the runtime. Parameter name: type The good news is it looks so much prettier in VS 2008. It's not fixed, but look...
with no comments
Filed under: , ,
I've updated the Snippet editor to work with Visual Studio 2008 and 2005 releases. Note this release requires .NET 3.5. Changes/fixes: Added 2008 product range to the list of products Fixed replacement of the install root variable for Visual Studio...
I recall almost four years ago to this day, I was at the 2003 PDC in LA. On the last day of the conference, the head architects of different .NET languages got together and talked about language directions, generics and some of the "VS 2005"...
1 comment(s)
Filed under: , , , ,
Paul Vick released some statistics in relation to VB , which for discussion sake I'll repeat here : Visual Basic is the #1 .NET language (as reported by Forrester Research) Visual Basic is the #1 downloaded and #1 registered Express Edition (topping...
Expression trees allow you to walk through all the information about an expression. So you can use this to create a NameOf function similar to the one I outlined in my post on VB 10 thoughts (part 5) <Extension()> _ Function NameOf( Of T1)( ByVal...
with no comments
Filed under: , , ,
I wrote a couple of really simple extension methods, Cast, and TryCast, that allow me to write code such as sender.Cast(Of Control).Text = "hello world" <Extension()> _ Function Cast( Of T)( ByVal obj As Object ) As T Return DirectCast...
with no comments
Filed under: , ,
Thanks to Julie's post , I decided to dig deeper into the depths of VB than any sane man should go. While playing with nullable dates in the query, I was wondering why I could get the number of orders with a null ShipDate. I tried: Dim query = From...
2 comment(s)
Filed under: , , ,
C# has some interesting rules for operators on nullable types. Given: int? x ; int? y ; Laws of transitivity tells us that if x is equal to y, (x == y), then x<= y would be true too. Well not in C#. With this function: static void test(int? arg1, int...
8 comment(s)
Filed under: , , ,
Was just reading Julie Lerman's blog and noticed the issue she had wouldn't have happened if Option Strict was on. This really highlights the problem of having implicit conversions occur at runtime.
with no comments
Filed under: , , ,
I just finished writing an article about Expression Trees for Visual Studio Magazine (aka VBPJ ) and there seemed to be some "holes" that I think should be plugged. An expression tree is basically a descriptive way of representing a lambda function...
with no comments
Filed under: , , , ,
VB9 provides intellisense support for XElement if you add the schema to the project and import the relevant namespaces. This is just awesome ! Earlier tonight I wanted a list of shortcuts for all the snippets so I added the snippet schema to the project...
with no comments
Filed under: , , ,
If you've installed the Beta 2 samples for VB Orcas 2008, then you will likely find the solutions don't open. Problem is they are marked as being for "Orcas" not "2008". This quick and dirty code will fix the problem: With...
5 comment(s)
Filed under: , , ,