fixing warnings, per ryan suggestion, suprressing warning now. we'll revisit the if debug blocks later (#6010)

This commit is contained in:
Clint Rutkas 2020-08-17 14:52:27 -07:00 committed by GitHub
parent dad8cbecc1
commit 2ff439dc47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View File

@ -46,7 +46,9 @@ namespace Wox.Plugin.SharedCommands
Copy(subdir.FullName, temppath);
}
}
#pragma warning disable CS0168 // Variable is declared but never used. Due to #if debug vs release statement
catch (Exception e)
#pragma warning restore CS0168 // Variable is declared but never used
{
#if DEBUG
throw e;
@ -76,7 +78,9 @@ namespace Wox.Plugin.SharedCommands
return true;
}
#pragma warning disable CS0168 // Variable is declared but never used. Due to #if debug vs release statement
catch (Exception e)
#pragma warning restore CS0168 // Variable is declared but never used
{
#if DEBUG
throw e;
@ -96,7 +100,9 @@ namespace Wox.Plugin.SharedCommands
Directory.Delete(path, true);
}
}
#pragma warning disable CS0168 // Variable is declared but never used. Due to #if debug vs release statement
catch (Exception e)
#pragma warning restore CS0168 // Variable is declared but never used
{
#if DEBUG
throw e;

View File

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<Import Project="..\..\..\Version.props" />
<PropertyGroup>
@ -40,6 +40,13 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<None Include="README.md" />