private void SaveSpec(ItemSpec spec) { if (!Directory.Exists(TargetFilename)) { Directory.CreateDirectory(TargetFilename); } var fullFile = Path.Combine(TargetFilename, spec.Id.ToString(CultureInfo.InvariantCulture)); var stream = new FileStream(fullFile, FileMode.Create); stream.Write(spec.Id); stream.Write(spec.GetProperties().ToList()); stream.Close(); stream.Dispose(); }