6 blog posts tagged VB.NET

LINQ to SQL cheat sheet

A few short words to say Iโ€™ve put together a cheat sheet for LINQ to SQL with one page for C# and another for VB.NET.

It shows the syntax for a number of common query operations, manipulations and attributes and can be a very useful quick reference :)

Object Initializers in .NET 3.5

  • ๐Ÿ“…
  • ๐Ÿ“ 419
  • ๐Ÿ•™ 2
  • ๐Ÿ“ฆ .NET

One compiler improvement in .NET 3.5 is the object initializers feature that lets you concisely set properties of an object as you create it.

If youโ€™ve ever used VB.NET you may well have found and enjoyed the with keyword to write code such as:

Visual Studio 2003 โ€“ System.ArgumentException in debugger

I recently ran into a problem while debugging inside Visual Studio 2003.Net. Google couldnโ€™t find me an answer, only a few other people with the same problem. Hereโ€™s my solution in the hope it might save somebody else some time.

Whenever debugging a specific VB.NET application that used a C# class library I would receive the following error certain objects in the C# class library:

VB.NET to C# conversion

  • ๐Ÿ“…
  • ๐Ÿ“ 525
  • ๐Ÿ•™ 3
  • ๐Ÿ“ฆ .NET

I recently converted some components on a project from VB.NET to C#, mainly for overloading and better tool support (such as ReSharper). Some of the existing code was generated from my own CodeSmith templates, so a small rewrite to generate C# handled most of that.

The remaining code, while not extensive in size, is a rather complex affair and the prospect of debugging this code when hand-converted was a little daunting so I decided to give the demo version of VBConversionโ€™s VB.NET to C# Converter 1.31 a spin.

Lapsed-listeners โ€“ Memory leaks in subscriber-publisher scenarios

  • ๐Ÿ“…
  • ๐Ÿ“ 882
  • ๐Ÿ•™ 4
  • ๐Ÿ“ฆ .NET
  • ๐Ÿ’ฌ 1

Iโ€™ve been promising something .NET related for a whileโ€ฆ hereโ€™s something!

There exists a โ€˜gotchaโ€™ in .NET (and other programming environment) whereby an object has subscribed to another objects published event will not be garbage collected when you expect because the environment itself holds a reference to the subscriber inside the event notification system.