So is it best practice to only use C# for SharePoint development?

I found it very interesting to see that the MSDN article Best Practices: Using Disposable Windows SharePoint Services Objects only provides code samples in C#,   can we assume that it is NOT best practice to use VB.Net to develop for SharePoint or is it just the lack of the using Statement that has kept these examples out?

:)

[Update] I was wrong: There is a Using statement in VB.Net

Using site As New SPSite(“http:///portal.company.com”) Using web As SPWeb = site.OpenWeb() Console.WriteLine(web.Title) End Using End Using

Thanks to Paul Liebrand for pointing this out and helping all you VB.Net SharePoint developers to develop using best practice.

This entry was posted in Development, SharePoint and tagged . Bookmark the permalink.
  • Paul Liebrand

    I hate to be the one to inform you, but VB.NET does have a using statement. Here is a perfectly good example:

    Using site As New SPSite(“http:///portal.company.com”)
    Using web As SPWeb = site.OpenWeb()
    Console.WriteLine(web.Title)
    End Using
    End Using

    I do agree — there should be both C# and VB.NET examples out there for those who need it.

  • Andrew Woodward

    Thanks Paul, not being a VB.Net user I was not aware of this. Hopefully this tongue in cheek post will help to spread the word :)

  • Becky Isserman

    I find it incredibly odd that there are no webpart templates from MS for VB .Net. It feels as though the Sharepoint Development Team is more swayed towards C#. I also think that most of the .Net community uses C# over VB .Net. I have created a few VB .Net webparts and it felt like an incredible amount of pain just to get a single web part out.

  • Andrew Woodward

    Becky,

    I have to confess that I am also one of the many people who made the switch to C# from VB6, and I think your observations are correct in that most development teams now use C# as the primary language and only do VB.Net as a translation, if they really have to.

    But now the MSDN site supports comments perhaps the VB.Net users out there can start to share your VB.Net translations?