From b3afede7d0fe7770a44a51bc4463c32a8212e7cb Mon Sep 17 00:00:00 2001 From: Mikayla Hutchinson Date: Tue, 5 Jun 2018 10:07:29 -0700 Subject: [PATCH] Fix build warnings --- src/framework/GuiUnit_NET_4_5.csproj | 2 ++ src/framework/Internal/AssemblyHelper.cs | 4 ++-- src/framework/Internal/AsyncInvocationRegion.cs | 12 ++---------- src/framework/Internal/ThreadUtility.cs | 2 ++ 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/framework/GuiUnit_NET_4_5.csproj b/src/framework/GuiUnit_NET_4_5.csproj index e5c8e47..6d61f80 100644 --- a/src/framework/GuiUnit_NET_4_5.csproj +++ b/src/framework/GuiUnit_NET_4_5.csproj @@ -46,6 +46,7 @@ AllRules.ruleset ..\..\bin\Debug\net-4.5\nunitlite.xml false + 1574;1591 pdbonly @@ -57,6 +58,7 @@ AllRules.ruleset ..\..\bin\Release\net-4.5\nunitlite.xml false + 1574;1591 guiunit.snk diff --git a/src/framework/Internal/AssemblyHelper.cs b/src/framework/Internal/AssemblyHelper.cs index c9b8593..3cfe352 100755 --- a/src/framework/Internal/AssemblyHelper.cs +++ b/src/framework/Internal/AssemblyHelper.cs @@ -38,7 +38,7 @@ public class AssemblyHelper /// /// Gets the path from which the assembly defining a Type was loaded. /// - /// The Type. + /// The Type. /// The path. public static string GetAssemblyPath(Type type) { @@ -102,7 +102,7 @@ public static AssemblyName GetAssemblyName(Assembly assembly) #if !NETCF private static bool IsFileUri(string uri) { - return uri.ToLower().StartsWith(Uri.UriSchemeFile); + return uri.StartsWith(Uri.UriSchemeFile, StringComparison.OrdinalIgnoreCase); } // Public for testing purposes diff --git a/src/framework/Internal/AsyncInvocationRegion.cs b/src/framework/Internal/AsyncInvocationRegion.cs index 8c04006..fd15f9d 100755 --- a/src/framework/Internal/AsyncInvocationRegion.cs +++ b/src/framework/Internal/AsyncInvocationRegion.cs @@ -78,16 +78,8 @@ public override void Dispose() public override object WaitForPendingOperationsToComplete(object invocationResult) { - try - { - _currentContext.WaitForPendingOperationsToComplete(); - return invocationResult; - } - catch (Exception e) - { - //PreserveStackTrace(e); - throw; - } + _currentContext.WaitForPendingOperationsToComplete(); + return invocationResult; } } diff --git a/src/framework/Internal/ThreadUtility.cs b/src/framework/Internal/ThreadUtility.cs index f526247..f6b5d6b 100755 --- a/src/framework/Internal/ThreadUtility.cs +++ b/src/framework/Internal/ThreadUtility.cs @@ -61,7 +61,9 @@ public static void Kill(Thread thread, object stateInfo) // Although obsolete, this use of Resume() takes care of // the odd case where a ThreadStateException is received // so we continue to use it. + #pragma warning disable CS0618 // obsolete thread.Resume(); + #pragma warning restore CS0618 } if ( (thread.ThreadState & ThreadState.WaitSleepJoin) != 0 )