I referenced the System.Numerics dll for the UIDHelper in Evil DICOM. If you have no need of generating UIDs, you can just delete the UIDHelper class from EvilDicom.Helpers.UIDHelper and retarget the whole library to 3.5.
Or if you want to still generate UIDs you can do it the old fashioned way: replace the following in the UIDHelper class:
public static string GenerateUID()
{
return string.Format("{0}.{1}", "2.25", GenerateSystemGuid());
}
public static string GenerateUID(string prefix)
{
return string.Format("{0}.{1}", prefix, GenerateSystemGuid());
}
public static string GenerateUID(string countryCode, string vendorID, string suffix)
{
return string.Format("{0}.{1}.{2}.{3}", "2.16", countryCode, vendorID, suffix);
}
private static string GenerateSystemGuid()
{
Guid g = Guid.NewGuid();
uint[] uints = new uint[4];
Buffer.BlockCopy(g.ToByteArray(), 0, uints, 0, 16);
return String.Join("", uints.Select(i => i.ToString()).ToArray());
}
-Rex Cardan