Using the following code with polygon and multipolygons, I'm seeing an extra 4 zero'ed bytes at the end of any WKB output. PostGIS doesn't care about them, but SQL Server sees this as invalid WKB. EG:
Yeilds:
0x010300000001000000070000004...33BCC4B4000000000
Should yeild:
0x010300000001000000070000004...33BCC4B40
Shapefile shapefile = Shapefile.OpenFile(tempShpPath);
foreach (var feature in shapefile.Features)
{
byte[] wkb = feature.BasicGeometry.ToBinary();
Array.Resize(ref wkb, wkb.Length - 4); //chop off the weird last 4 bytes
//do something with the wkb
}