diff --git a/XenAdmin/Controls/SnapshotTreeView.cs b/XenAdmin/Controls/SnapshotTreeView.cs index bf71331bf..122e0a5d0 100644 --- a/XenAdmin/Controls/SnapshotTreeView.cs +++ b/XenAdmin/Controls/SnapshotTreeView.cs @@ -32,7 +32,6 @@ using System; using System.Collections.Generic; using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; using System.Drawing; using System.Drawing.Drawing2D; using System.Security.Permissions; @@ -155,9 +154,6 @@ namespace XenAdmin.Controls } - [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", - MessageId = "System.InvalidOperationException.#ctor(System.String)", - Justification = "Indicates a programming error - not user facing")] internal ListViewItem AddSnapshot(SnapshotIcon snapshot) { if (snapshot == null) diff --git a/XenOvfApi/Compression.cs b/XenOvfApi/Compression.cs index e9912c135..2cd16b1c9 100644 --- a/XenOvfApi/Compression.cs +++ b/XenOvfApi/Compression.cs @@ -152,8 +152,6 @@ namespace XenOvf /// /// /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", - Justification = "Logging only usage")] public void UncompressFile(string inputfile, string outputfile, string method) { if (method.ToLower() == "gzip") @@ -185,8 +183,7 @@ namespace XenOvf #region PRIVATE - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", - Justification = "Logging only usage")] + private void ProcessCompression(EnvelopeType env, string path, string method, bool compress) { if (env.References != null && env.References.File != null && env.References.File.Length > 0) diff --git a/XenOvfApi/Conversions.cs b/XenOvfApi/Conversions.cs index c92033952..f12c21e50 100644 --- a/XenOvfApi/Conversions.cs +++ b/XenOvfApi/Conversions.cs @@ -31,7 +31,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.IO; using System.Management; using System.Reflection; @@ -63,8 +62,6 @@ namespace XenOvf #region CONVERSIONS - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", - Justification = "Tar Object uses close not Dispose, it cleans up all streams used.")] public static void ConvertOVFtoOVA(string pathToOvf, string ovfFileName, bool compress, bool cleanup = true) { // throws exception if any of the parameters is null (which we want) @@ -1464,9 +1461,6 @@ namespace XenOvf log.DebugFormat("OVF.TransformXvaOvf_SR completed {0}", vsId); } - - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", - Justification = "Logging only usage")] private void CollectInformation() { Win32_ComputerSystem = null; @@ -1708,8 +1702,6 @@ namespace XenOvf AddVssd(ovfEnv, vsId, vhsId, Properties.Settings.Default.Language); } - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", - Justification = "Logging mechanism")] private void AddVssd(EnvelopeType ovfEnv, string vsId, string vhsId, string lang) { @@ -1775,8 +1767,6 @@ namespace XenOvf AddNetworks(ovfEnv, vsId, Properties.Settings.Default.Language); } - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", - Justification = "Logging mechanism")] private void AddNetworks(EnvelopeType ovfEnv, string vsId, string lang) { if (Win32_NetworkAdapter != null) @@ -1875,8 +1865,6 @@ namespace XenOvf AddCPUs(ovfEnv, vsId, Properties.Settings.Default.Language); } - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", - Justification = "Logging mechanism")] private void AddCPUs(EnvelopeType ovfEnv, string vsId, string lang) { UInt64 cpucount = 0; @@ -1916,8 +1904,6 @@ namespace XenOvf AddMemory(ovfEnv, vsId, Properties.Settings.Default.Language); } - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", - Justification = "Logging mechanism")] private void AddMemory(EnvelopeType ovfEnv, string vsId, string lang) { ulong divisor = 1024*1024; @@ -1955,8 +1941,6 @@ namespace XenOvf CreateConnectedDevices(ovfEnv, vsId, Properties.Settings.Default.Language, vhdExports); } - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", - Justification = "Logging mechanism")] private void CreateConnectedDevices(EnvelopeType ovfEnv, string vsId, string lang, DiskInfo[] vhdExports) { //VirtualHardwareSection_Type vhs = FindVirtualHardwareSection(ovfEnv, vsId); diff --git a/XenOvfApi/OVF.cs b/XenOvfApi/OVF.cs index bd56bd9f9..02d715a73 100644 --- a/XenOvfApi/OVF.cs +++ b/XenOvfApi/OVF.cs @@ -243,8 +243,6 @@ namespace XenOvf /// InstanceID /// string short description /// string longer description - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", - Justification = "Logging mechanism")] public static string AddCDROM(EnvelopeType ovfObj, string vsId, string lang, string cdId, string caption, string description) { RASD_Type rasd = new RASD_Type(); @@ -289,8 +287,6 @@ namespace XenOvf /// String identifying the device to match to the controller /// which controller 0 = first, 1, 2, 3... (per type) /// InstanceID of Controller - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", - Justification = "Logging mechanism")] public void AddController(EnvelopeType ovfObj, string vsId, string lang, DeviceType type, string deviceId, int iteration) { VirtualHardwareSection_Type[] vhsArray = FindVirtualHardwareSection(ovfObj, vsId); @@ -312,8 +308,6 @@ namespace XenOvf /// String identifying the device to match to the controller /// which controller 0 = first, 1, 2, 3... (per type) /// InstanceID of Controller - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", - Justification = "Logging mechanism")] public void AddControllerToVHS(object vhsObj, string lang, DeviceType type, string deviceId, int iteration) { VirtualHardwareSection_Type vhs = (VirtualHardwareSection_Type)vhsObj; @@ -429,8 +423,6 @@ namespace XenOvf /// instance ID of device /// instance ID of controller /// where on controller 0... - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", - Justification = "Logging mechanism")] public void AddDeviceToController(EnvelopeType ovfObj, string vsId, string lang, string deviceInstanceId, string controllerInstanceId, string AddressOnController) { VirtualHardwareSection_Type[] vhsArray = FindVirtualHardwareSection(ovfObj, vsId); @@ -474,8 +466,6 @@ namespace XenOvf /// System Index in OVF to set memory value (0 = first VM) /// Section Index in Virtual Hardware Section (1 = VHS index) /// Instance ID of Disk - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", - Justification = "Logging mechanism")] public static void AddDisk(EnvelopeType ovfEnv, string vsId, string diskId, string lang, string vhdFileName, bool bootable, string name, string description, ulong filesize, ulong capacity) { List files = new List(); @@ -5427,8 +5417,7 @@ namespace XenOvf { AddContent(systemColl, vsId, Properties.Settings.Default.Language, item); } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", - Justification = "Logging mechanism")] + private static void AddContent(VirtualSystemCollection_Type systemColl, string vsId, string lang, object item) { List sections = new List(); diff --git a/XenOvfTransport/Import.cs b/XenOvfTransport/Import.cs index c71ea4dfa..33daa8ef9 100644 --- a/XenOvfTransport/Import.cs +++ b/XenOvfTransport/Import.cs @@ -491,8 +491,6 @@ namespace XenOvfTransport } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", - Justification = "Logging mechanism")] internal List> ImportFile(Session xenSession, string vmname, string pathToOvf, string filename, string compression, string version, string passcode, string sruuid, string description, string vdiuuid) { List> vdiRef = new List>(); @@ -1982,8 +1980,7 @@ namespace XenOvfTransport } } } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", - Justification = "Logging mechanism")] + private string VerifyUserDevice(Session xenSession, XenRef vmRef, string device) { log.DebugFormat("Import.VerifyUserDevice, checking device: {0} (99 = autoselect)", device); diff --git a/XenOvfTransport/iSCSI.cs b/XenOvfTransport/iSCSI.cs index eb5d3d205..0897c57c5 100644 --- a/XenOvfTransport/iSCSI.cs +++ b/XenOvfTransport/iSCSI.cs @@ -35,7 +35,6 @@ using System.IO; using System.Threading; using DiscUtils.Iscsi; using XenAPI; -using SuppressMessage = System.Diagnostics.CodeAnalysis.SuppressMessageAttribute; namespace XenOvfTransport @@ -89,7 +88,6 @@ namespace XenOvfTransport } } - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Logging mechanism")] public DiskStream Connect(XenAPI.Session xenSession, string vdiuuid, bool read_only) { StartiScsiTarget(xenSession, vdiuuid, read_only); @@ -184,7 +182,6 @@ namespace XenOvfTransport } } - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Logging mechanism")] public void Disconnect(XenAPI.Session xenSession) { try @@ -212,7 +209,6 @@ namespace XenOvfTransport StopiScsiTarget(xenSession); } - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Logging mechanism")] public void Copy(Stream source, Stream destination, string filename, bool shouldHash) { log.InfoFormat("Started copying {0} bytes to {1} via iSCSI.", source.Length, filename); @@ -295,7 +291,6 @@ namespace XenOvfTransport log.InfoFormat("Finished copying {0} bytes to {1} via iSCSI.", source.Length, filename); } - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Logging mechanism")] public void Verify(Stream target, string filename) { log.InfoFormat("Started verifying {0} bytes in {1} after copy via iSCSI.", _bytescopied, filename); @@ -479,7 +474,6 @@ namespace XenOvfTransport UpdateHandler.Invoke(e); } - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Logging mechanism")] private void StartiScsiTarget(XenAPI.Session xenSession, string vdiuuid, bool read_only) { try @@ -510,7 +504,6 @@ namespace XenOvfTransport } } - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Logging mechanism")] private void StopiScsiTarget(XenAPI.Session xenSession) { try