Common .NET Helper functions