Generate assembly HEX

In case you don't have access to SQL Server file system in order to copy your assembly file, you can generate hex code:

private static String GenerateHexCode(String assemblyPath)
{
        if (!Path.IsPathRooted(assemblyPath))
                assemblyPath = Path.Combine(Environment.CurrentDirectory, assemblyPath);

        var builder = new StringBuilder();
        builder.Append("0x");

        using (var stream = new FileStream(assemblyPath,
                        FileMode.Open, FileAccess.Read, FileShare.Read))
        {
                int currentByte = stream.ReadByte();
                while (currentByte > -1)
                {
                        builder.Append(currentByte.ToString("X2",
                                CultureInfo.InvariantCulture));
                        currentByte = stream.ReadByte();
                }
        }

        return builder.ToString();
}

then register .NET assembly:

CREATE ASSEMBLY <AssemblyName.dll>
AUTHORIZATION [dbo]
FROM <hex code here>
WITH PERMISSION_SET = SAFE
GO

Is this useful?