diff --git a/Directory.Packages.props b/Directory.Packages.props index e43ea8ab..c8825755 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -2,7 +2,7 @@ true true - $(NoWarn);NU1507 + $(NoWarn);NU1507;NU1701 diff --git a/ObjectListView/SubControls/ToolTipControl.cs b/ObjectListView/SubControls/ToolTipControl.cs index 9cd345a9..d9b69b44 100644 --- a/ObjectListView/SubControls/ToolTipControl.cs +++ b/ObjectListView/SubControls/ToolTipControl.cs @@ -645,7 +645,6 @@ namespace BrightIdeasSoftware /// Mess with the basic message pump of the tooltip /// /// - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] override protected void WndProc(ref Message msg) { //System.Diagnostics.Trace.WriteLine(String.Format("xx {0:x}", msg.Msg)); switch (msg.Msg) { @@ -697,5 +696,4 @@ namespace BrightIdeasSoftware #endregion } - } \ No newline at end of file diff --git a/mRemoteNG/Connection/PuttySessionInfo.cs b/mRemoteNG/Connection/PuttySessionInfo.cs index eb2eb4da..f8eb72dc 100644 --- a/mRemoteNG/Connection/PuttySessionInfo.cs +++ b/mRemoteNG/Connection/PuttySessionInfo.cs @@ -103,7 +103,7 @@ namespace mRemoteNG.Connection Disposed?.Invoke(this, EventArgs.Empty); } - public event EventHandler Disposed; + public event EventHandler? Disposed; #endregion } diff --git a/mRemoteNG/Tools/Authenticode.cs b/mRemoteNG/Tools/Authenticode.cs index 161363bb..d51e7dac 100644 --- a/mRemoteNG/Tools/Authenticode.cs +++ b/mRemoteNG/Tools/Authenticode.cs @@ -46,17 +46,19 @@ namespace mRemoteNG.Tools return Status; } - //X509Certificate2 certificate2 = new(X509Certificate.CreateFromSignedFile(FilePath)); +#pragma warning disable SYSLIB0057 + using X509Certificate cert = X509Certificate.CreateFromSignedFile(FilePath); + byte[] certData = cert.GetRawCertData(); +#pragma warning restore SYSLIB0057 + X509Certificate2 certificate2 = X509CertificateLoader.LoadCertificate(certData); + _thumbprint = certificate2.Thumbprint; - X509Certificate2 certificate2 = new(X509Certificate.CreateFromSignedFile(FilePath)); - _thumbprint = certificate2.Thumbprint; - - if (_thumbprint != ThumbprintToMatch) - { - Status = StatusValue.ThumbprintNotMatch; - return Status; - } - } + if (_thumbprint != ThumbprintToMatch) + { + Status = StatusValue.ThumbprintNotMatch; + return Status; + } + } NativeMethods.WINTRUST_FILE_INFO trustFileInfo = new() { pcwszFilePath = FilePath}; trustFileInfoPointer = Marshal.AllocCoTaskMem(Marshal.SizeOf(trustFileInfo)); diff --git a/mRemoteNG/Tools/SSHTunnelTypeConverter.cs b/mRemoteNG/Tools/SSHTunnelTypeConverter.cs index e94d93b1..c77a3d21 100644 --- a/mRemoteNG/Tools/SSHTunnelTypeConverter.cs +++ b/mRemoteNG/Tools/SSHTunnelTypeConverter.cs @@ -42,17 +42,17 @@ namespace mRemoteNG.Tools return result; } - public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) + public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext? context) { return new StandardValuesCollection(SshTunnels); } - public override bool GetStandardValuesExclusive(ITypeDescriptorContext context) + public override bool GetStandardValuesExclusive(ITypeDescriptorContext? context) { return true; } - public override bool GetStandardValuesSupported(ITypeDescriptorContext context) + public override bool GetStandardValuesSupported(ITypeDescriptorContext? context) { return true; } diff --git a/mRemoteNG/UI/TaskDialog/CommandButton.cs b/mRemoteNG/UI/TaskDialog/CommandButton.cs index 6f4d5ef0..7fd67066 100644 --- a/mRemoteNG/UI/TaskDialog/CommandButton.cs +++ b/mRemoteNG/UI/TaskDialog/CommandButton.cs @@ -40,7 +40,7 @@ namespace mRemoteNG.UI.TaskDialog //-------------------------------------------------------------------------------- // Override this to make sure the control is invalidated (repainted) when 'Text' is changed - public override string Text + public override string? Text { get => base.Text; set diff --git a/mRemoteNG/mRemoteNG.csproj b/mRemoteNG/mRemoteNG.csproj index 0f9c1731..6c6818f7 100644 --- a/mRemoteNG/mRemoteNG.csproj +++ b/mRemoteNG/mRemoteNG.csproj @@ -3,6 +3,7 @@ x64;arm64 win-x64;win-arm64 + $(NoWarn);NU1701 WinExe @@ -149,59 +150,16 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -